-
Notifications
You must be signed in to change notification settings - Fork 5
Activation refactor #117
base: master
Are you sure you want to change the base?
Activation refactor #117
Conversation
5345af5
to
2a6a60e
Compare
2a6a60e
to
bd9208b
Compare
@@ -1,7 +1,7 @@ | |||
{ | |||
"extends": "./node_modules/@sourcegraph/tsconfig/tsconfig.json", | |||
"compilerOptions": { | |||
"target": "es2016", | |||
"target": "es2019", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need async generators now.
src/lang-go.ts
Outdated
doc, | ||
pos, | ||
sendRequest, | ||
}: { | ||
doc: sourcegraph.TextDocument | ||
pos: sourcegraph.Position | ||
sendRequest: SendRequest<any> | ||
}): Observable<lspext.Xreference & { currentDocURI: string }> { | ||
}): AsyncGenerator<lspext.Xreference & { currentDocURI: string }> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return async generator instead of observable so we don't have to go from observable -> async generator -> observable later in the code.
src/lang-go.ts
Outdated
definition: () => Promise.resolve(undefined), | ||
references: () => Promise.resolve(undefined), | ||
} | ||
// interface MaybeProviders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will clean up this and additional dead code in a cleanup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified the following behavior remains unchanged:
- With
go.serverUrl
set- On a repo missing LSIF
- Hover: LSIF fails, falls back to LSP
- Definition: LSIF fails, falls back to LSP
- References: LSP is used
- On a repo with LSIF
- Hover: LSIF succeeds
- Definition: LSIF succeeds
- References: LSP is used
- On a repo missing LSIF
- With
go.serverUrl
not set: same as Activation refactor code-intel-extensions#198 (review)
This PR cleans up the init code after sourcegraph/code-intel-extensions#198.
This removes all LSIF and search-based logic and instead delegates to the
activateCodeIntel
function, passing it only the language-server specific logic.This PR will be followed by a major cleanup.