lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Extension does not activate for virtual documents

Open roblunx opened this issue 3 years ago • 1 comments

Describe the bug When performing request forwarding from one extension to this extension it does not produce any responses for virtual documents until a proper lua text document is opened in a visible text editor.

Background: I have made a language extension for an assembler which may have embedded lua scripts. To get lua language support I've implemented this via request forwarding and virtual documents as described in the VSCode documentation here. The text document provider for the virtual documents is registered with the schema c6510-embedded-content and I have also added it manually to the configuration setting Lua.workspace.supportScheme for this lua extension.

To Reproduce Steps to reproduce the behavior:

  1. Install the extension roblunx.c6510-asm
  2. Open a new workspace
  3. Open a new file with suffix .s or set language to c6510-asm
  4. Type content like lua print("foo")
  5. Make sure the file exists on disk by saving
  6. Completion and hover in the .s file will not work.

Next:

  1. Open a new document in the same workspace and set language to lua.
  2. Go back to the .s file and hover the embedded lua code (e.g. print function) and it will show hover info.
  3. It still does not work for new documents that hasn't been saved.

Expected behaviorr** The lua extension should be activated for the workspace and provide completion and hover results also for virtual lua documents.

Environment (please complete the following information):

  • OS: macOS
  • Client: VSCode 1.68.1

Provided logs service.log file_Users_user_Documents_vscode-c6510-asm.log

roblunx avatar Jul 06 '22 11:07 roblunx

AFAIK, the extension is actived by events, this extension register events:

"activationEvents": [
    "onLanguage:lua",
    "onWebviewPanel:lua-doc",
    "onCommand:extension.lua.doc"
],

Maybe there are some API of VSCode to active these events.

sumneko avatar Jul 06 '22 15:07 sumneko

Issue has gone stale

carsakiller avatar Nov 12 '22 07:11 carsakiller