Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

textDocument/didOpen text is ignored #424

Open
@bmeck

Description

@bmeck

The following log shows the problem. textDocument/didOpen doesn't appear to prevent the langserver from using the URL to fetch the body of a document.

DEBUG TRACE
LMDV-BRADLEY:snapshot-utils bfarias$ javascript-typescript-langserver -t
DEBUG Spawning 8 workers
DEBUG Worker 2 (PID 26634) online
DEBUG Worker 6 (PID 26638) online
DEBUG Worker 3 (PID 26635) online
DEBUG Worker 8 (PID 26640) online
DEBUG Worker 1 (PID 26633) online
DEBUG Worker 4 (PID 26636) online
DEBUG Worker 5 (PID 26637) online
DEBUG Worker 7 (PID 26639) online
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
INFO  Listening for incoming LSP connections on 2089
DEBUG Connection 1 accepted
DEBUG --> { jsonrpc: '2.0',
  id: 1,
  method: 'initialize',
  params:
   { rootUri: 'file:///Users/bfarias/Documents/repl/langserver',
     capabilities: {} } }
DEBUG <-- { jsonrpc: '2.0',
  id: 1,
  result:
   { capabilities:
      { textDocumentSync: 1,
        hoverProvider: true,
        signatureHelpProvider: { triggerCharacters: [ '(', ',' ] },
        definitionProvider: true,
        referencesProvider: true,
        documentSymbolProvider: true,
        workspaceSymbolProvider: true,
        xworkspaceReferencesProvider: true,
        xdefinitionProvider: true,
        xdependenciesProvider: true,
        completionProvider: { resolveProvider: true, triggerCharacters: [ '.' ] },
        codeActionProvider: true,
        renameProvider: true,
        executeCommandProvider: { commands: [] },
        xpackagesProvider: true } } }
DEBUG --> { jsonrpc: '2.0',
  method: 'textDocument/didOpen',
  params:
   { textDocument:
      { uri: 'file:///Users/bfarias/Documents/repl/langserver/client.js',
        languageId: 'javascript',
        version: 1,
        text: 'Array.' } } }
DEBUG --> { jsonrpc: '2.0',
  id: 2,
  method: 'textDocument/completion',
  params:
   { textDocument:
      { uri: 'file:///Users/bfarias/Documents/repl/langserver/client.js' },
     position: { line: 0, character: 6 } } }
DEBUG <-- { jsonrpc: '2.0',
  id: 2,
  result: { isIncomplete: true, items: [] } }
DEBUG <-- { jsonrpc: '2.0',
  method: 'textDocument/publishDiagnostics',
  params:
   { uri: 'file:///Users/bfarias/Documents/repl/langserver/client.js',
     diagnostics:
      [ { range:
           { start: { character: 0, line: 0 },
             end: { character: 0, line: 0 } },
          message: 'Identifier expected.',
          severity: 1,
          code: 1003,
          source: 'ts' } ] } }

The `client.js` content starts with `'use strict';` and modifying that line does show that it is being used for the completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions