typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Running LSP throws error while running default build task

Open Viijay-Kr opened this issue 9 months ago • 5 comments

Running the prototype LSP inside vscode debugger throws the following error

Image

The configured build task fails before opening Ext host. It doesn't work unless one explicitly runs npm run build inside _extension and then launch the Language service

Would be nice to have this one fixed or the docs is correctly updated.

Might help people without extension API knowledge to be able to test the LSP service

Viijay-Kr avatar Mar 13 '25 17:03 Viijay-Kr

Running npm run build should not be required; the launch task should automatically work. What specifically did you do to make this occur?

jakebailey avatar Mar 13 '25 18:03 jakebailey

  1. I cloned the repo (with submodules)
  2. npm ci in the root
  3. Opened the project in vs code
  4. Ran the Launch VS code debugger config
  5. The extension host opened with an activation error (see image)

I checked the watch/build task in the terminal and saw this error.

Image

From the error I know the _extension dist folder never got generated thus I ran the build inside _extension folder manually and launched the debugger again and this time the extension is activated

I think the npm err seems obvious atleast in my machine, given there is no script called typescript-lsp in root package json

Do i need to do anything before launching the debugger ?

Viijay-Kr avatar Mar 13 '25 18:03 Viijay-Kr

You steps don't include copying launch.template.json to launch.json. Did you do that too?

jakebailey avatar Mar 13 '25 18:03 jakebailey

You steps don't include copying launch.template.json to launch.json. Did you do that too?

Oh yes I did that too

Viijay-Kr avatar Mar 15 '25 11:03 Viijay-Kr

Might be ${workspaceRoot} issue make sure you opened the project in the folder.(code . in terminal)

ocan4214 avatar Mar 15 '25 14:03 ocan4214

The build I think has improved to fix this, but if you're just experimenting (which is what I think was happening these many months ago), just use the published VS Code extension.

jakebailey avatar Jun 04 '25 07:06 jakebailey