Skip to content

Commit 7019e4f

Browse files
committed
Fall back to basic-code-intel when python.serverUrl is not set
1 parent fe218c1 commit 7019e4f

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"typescript": "^3.1.3"
6060
},
6161
"dependencies": {
62+
"@sourcegraph/basic-code-intel": "^1.0.0",
6263
"@types/ws": "^6.0.1",
6364
"rxjs": "^6.3.3",
6465
"tagged-template-noop": "^2.1.0",

‎src/sourcegraph-python.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { activateOnFileExts as activateBasicCodeIntelOnFileExts } from '@sourcegraph/basic-code-intel'
12
// tslint:disable-next-line:rxjs-no-wholesale
23
import { combineLatest, concat, from, Observable, of, Subject } from 'rxjs'
34
import { map, startWith, tap } from 'rxjs/operators'
@@ -41,13 +42,12 @@ export function activate(ctx: sourcegraph.ExtensionContext = DUMMY_CTX): void {
4142
const docURL = `${sourcegraph.internal.sourcegraphURL
4243
.toString()
4344
.replace(/\/$/, '')}/extensions/sourcegraph/python`
44-
sourcegraph.app.activeWindow.showNotification(
45-
'Configure `python.serverUrl` in user settings for Python code intelligence.\n\n[Documentation](' +
46-
docURL +
47-
')'
45+
console.log(
46+
'Configure `python.serverUrl` in user settings for more accurate Python code intelligence.',
47+
docURL
4848
)
4949
}
50-
return
50+
return activateBasicCodeIntelOnFileExts(['py'])(ctx)
5151
}
5252

5353
const connectionManager = new LanguageServerConnectionManager(

‎yarn.lock‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,13 @@
734734
dependencies:
735735
esquery "^1.0.1"
736736

737+
"@sourcegraph/basic-code-intel@^1.0.0":
738+
version "1.0.0"
739+
resolved "https://registry.yarnpkg.com/@sourcegraph/basic-code-intel/-/basic-code-intel-1.0.0.tgz#3e315936f4cd3132e5b837b944f6dcdad0b47a7e"
740+
integrity sha512-fGYsUzNDx8kA4qbhg147RyaSsU4AX+kz2ywkBMNFqZ/7CsCFSrt7RAyaHB5Lv0vnlybi0x/rtS++CDGMkdW0FA==
741+
dependencies:
742+
rxjs "^6.3.3"
743+
737744
"@sourcegraph/tsconfig@^3.0.0":
738745
version "3.0.0"
739746
resolved "https://registry.yarnpkg.com/@sourcegraph/tsconfig/-/tsconfig-3.0.0.tgz#dfd8a0072d55a219118f58cfbca71336b58991b2"

0 commit comments

Comments
 (0)