Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const webSocket = new WebSocket(address)
const conn = createWebSocketConnection(wsrpc.toSocket(webSocket), new ConsoleLogger())
webSocket.addEventListener('open', () => resolve(conn))
webSocket.addEventListener('error', event => reject(new Error(connectingToGoLangserverHelp)))
} catch (e) {
if ('message' in e && /Failed to construct/.test(e.message)) {
console.error(connectingToGoLangserverHelp)
}
reject(e)
}
})) as rpc.MessageConnection
connection.listen()
try {
await connection.sendRequest(
new lspProtocol.RequestType<
lspProtocol.InitializeParams & {
originalRootUri: string
rootPath: string
},
lspProtocol.InitializeResult,
lspProtocol.InitializeError,
void
>('initialize') as any,
{
originalRootUri: root.href,
rootUri: 'file:///',
rootPath: '/',
initializationOptions: {
zipURL: constructZipURL({
repoName: repoName(root.href).replace(/^\/+/, ''),
revision: root.search.substr(1),
const candidates = (async () => {
const definitions = (await sendRequest({
rootURI: rootURIFromDoc(doc),
requestType: new lspProtocol.RequestType('textDocument/xdefinition') as any,
request: positionParams(doc, pos),
useCache: true,
})) as lspext.Xdefinition[] | null
if (!definitions) {
console.error('No response to xdefinition')
return Promise.reject()
}
if (definitions.length === 0) {
console.error('No definitions')
return Promise.reject()
}
const definition = definitions[0]
const limit = sourcegraph.configuration.get().get('go.maxExternalReferenceRepos') || 20
const gddoURL = sourcegraph.configuration.get().get('go.gddoURL')
const corsAnywhereURL = sourcegraph.configuration.get().get('go.corsAnywhereURL')
function composeForward(f: (a: A) => B, g: (b: B) => C): (a: A) => C {
AllFixesParams,
AllFixesResult,
void,
void
>('textDocument/tslint/allFixes')
}
interface NoTSLintLibraryParams {
readonly source: TextDocumentIdentifier
}
interface NoTSLintLibraryResult {
}
namespace NoTSLintLibraryRequest {
export const type = new RequestType('tslint/noLibrary')
}
interface Settings {
enable: boolean
jsEnable: boolean
rulesDirectory: string | string[]
configFile: string
tsConfigFile: string
ignoreDefinitionFiles: boolean
exclude: string | string[]
validateWithDefaultConfig: boolean
nodePath: string | undefined
run: 'onSave' | 'onType'
alwaysShowRuleFailuresAsWarnings: boolean
autoFixOnSave: boolean | string[]
trace: any
const errorRegex = /^(\w+):\s+([^\[]+)\[(\d+),\s*(\d+)\]:\s+(.*)$/
interface AllFixesParams {
readonly textDocument: TextDocumentIdentifier
readonly isOnSave: boolean
}
interface AllFixesResult {
readonly documentVersion: number
readonly edits: TextEdit[]
readonly ruleId?: string
readonly overlappingFixes: boolean
}
namespace AllFixesRequest {
export const type = new RequestType<
AllFixesParams,
AllFixesResult,
void,
void
>('textDocument/tslint/allFixes')
}
interface NoTSLintLibraryParams {
readonly source: TextDocumentIdentifier
}
interface NoTSLintLibraryResult {
}
namespace NoTSLintLibraryRequest {
export const type = new RequestType('tslint/noLibrary')
autoFixOnSave: boolean
options: any | undefined
run: RunValues
workspaceFolder: WorkspaceFolder | undefined
workingDirectory: DirectoryItem | undefined
}
interface NoConfigParams {
message: string
document: TextDocumentIdentifier
}
interface NoConfigResult { }
namespace NoConfigRequest {
export const type = new RequestType<
NoConfigParams,
NoConfigResult,
void,
void
>('eslint/noConfig')
}
interface NoESLintLibraryParams {
source: TextDocumentIdentifier
}
interface NoESLintLibraryResult { }
namespace NoESLintLibraryRequest {
export const type = new RequestType<
NoESLintLibraryParams,
const errorRegex = /^\s*(\w+):\s+([^:]+):(\d+):\s*(\d+)\s+-\s+(.*)/
interface AllFixesParams {
readonly textDocument: TextDocumentIdentifier
readonly isOnSave: boolean
}
interface AllFixesResult {
readonly documentVersion: number
readonly edits: TextEdit[]
readonly ruleId?: string
readonly overlappingFixes: boolean
}
namespace AllFixesRequest {
export const type = new RequestType<
AllFixesParams,
AllFixesResult,
void,
void
>('textDocument/tslint/allFixes')
}
interface NoTSLintLibraryParams {
readonly source: TextDocumentIdentifier
}
interface NoTSLintLibraryResult {
}
namespace NoTSLintLibraryRequest {
export const type = new RequestType('tslint/noLibrary')
}
export interface FoldingRangeRequestParam {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The maximum number of ranges to provide
*/
maxRanges?: number;
}
export namespace FoldingRangesRequest {
export const type: RequestType = new RequestType('textDocument/foldingRanges');
}
(function (AllFixesRequest) {
AllFixesRequest.type = new vscode_languageserver_protocol_1.RequestType('textDocument/tslint/allFixes');
})(AllFixesRequest || (AllFixesRequest = {}));
var NoTSLintLibraryRequest;