Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@sourcegraph/vscode-ws-jsonrpc": "^0.0.3-fork",
"lodash": "^4.17.11",
"rxjs": "^6.4.0",
"sourcegraph": "^22.0.0",
"sourcegraph": "^23.0.0",
"type-zoo": "^3.2.1",
"uuid": "^3.3.2",
"vscode-languageserver-protocol": "^3.14.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export async function register({
textDocument: {
uri: serverTextDocumentUri.href,
languageId: textDocument.languageId,
text: textDocument.text,
text: textDocument.text || '', // TODO try to fetch contents from somewhere
version: 1,
},
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const logger = new NoopLogger()
describe('register()', () => {
it('should initialize one connection with each workspace folder if the server is multi-root capable', async () => {
const sourcegraph = createMockSourcegraphAPI()
sourcegraph.workspace.roots = [{ uri: 'git://repo1?rev' }, { uri: 'git://repo2?rev' }]
sourcegraph.workspace.roots = [{ uri: new URL('git://repo1?rev') }, { uri: new URL('git://repo2?rev') }]
const server = {
initialize: sinon.spy((params: InitializeParams): InitializeResult => ({ capabilities: {} })),
}
Expand All @@ -49,7 +49,7 @@ describe('register()', () => {
})
it('should initialize one connection for each workspace folder if the server is not multi-root capable', async () => {
const sourcegraph = createMockSourcegraphAPI()
sourcegraph.workspace.roots = [{ uri: 'git://repo1?rev' }, { uri: 'git://repo2?rev' }]
sourcegraph.workspace.roots = [{ uri: new URL('git://repo1?rev') }, { uri: new URL('git://repo2?rev') }]
const server = {
initialize: sinon.spy((params: InitializeParams): InitializeResult => ({ capabilities: {} })),
}
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('register()', () => {
})
it('should close a connection when a workspace folder is closed', async () => {
const sourcegraph = createMockSourcegraphAPI()
sourcegraph.workspace.roots = [{ uri: 'git://repo1?rev' }, { uri: 'git://repo2?rev' }]
sourcegraph.workspace.roots = [{ uri: new URL('git://repo1?rev') }, { uri: new URL('git://repo2?rev') }]
const server = {
initialize: sinon.spy((params: InitializeParams): InitializeResult => ({ capabilities: {} })),
}
Expand All @@ -99,7 +99,7 @@ describe('register()', () => {
sinon.assert.calledOnce(createConnection.returnValues[0].unsubscribe)
})
it('should register a references provider if the server reports the references capability', async () => {
const repoRoot = 'https://sourcegraph.test/repo@rev/-/raw/'
const repoRoot = new URL('https://sourcegraph.test/repo@rev/-/raw/')
const server = {
initialize: sinon.spy(
(params: InitializeParams): InitializeResult => ({
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('register()', () => {
])
})
it('should register a definition provider if the server reports the definition capability', async () => {
const repoRoot = 'https://sourcegraph.test/repo@rev/-/raw/'
const repoRoot = new URL('https://sourcegraph.test/repo@rev/-/raw/')
const server = {
initialize: sinon.spy(
(params: InitializeParams): InitializeResult => ({
Expand Down Expand Up @@ -257,7 +257,7 @@ describe('register()', () => {
])
})
it('should register a hover provider if the server reports the hover capability', async () => {
const repoRoot = 'https://sourcegraph.test/repo@rev/-/raw/'
const repoRoot = new URL('https://sourcegraph.test/repo@rev/-/raw/')
const server = {
initialize: sinon.spy(
async (params: InitializeParams): Promise<InitializeResult> => ({
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5233,10 +5233,10 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

sourcegraph@^22.0.0:
version "22.0.0"
resolved "https://registry.npmjs.org/sourcegraph/-/sourcegraph-22.0.0.tgz#b259929c31bf367f5160056698a881dc26eb36bd"
integrity sha512-cJHby0OPCM0y0BmRTKhY89D02f9koROluHMJGQGNE8q9CoIVbe1s6ctHCytz7bjY9mKtCpQMbtxYQhfIm5S4lg==
sourcegraph@^23.0.0:
version "23.0.0"
resolved "https://registry.yarnpkg.com/sourcegraph/-/sourcegraph-23.0.0.tgz#1fb96015af3e84cc9cc2944823f04a7e952ed565"
integrity sha512-hQALHrTt+AK5ZAqUAUNhxO7ClSv/xyTjMQPBb+hQykKJrMaHTk+CnJNHs7dRfXYKnbnZeisQRjaxKGX8UecU0Q==

spawn-error-forwarder@~1.0.0:
version "1.0.0"
Expand Down