Gimly / vscode-matlab

MATLAB support for Visual Studio Code
MIT License
181 stars 35 forks source link

can't use linter in 2.20 #140

Closed peter-liuseu closed 2 years ago

jimga150 commented 3 years ago

Same here. Downgrading to 2.0.1 fixed the issue.

Gimly commented 3 years ago

OK, I must have messed up something while publishing, I'll take a look, thanks.

mjdshibly commented 3 years ago

As a temporary fix for this issue, you can do the following:

  1. Make sure that you have "npm" installed.
  2. In the Command Palette search for the following command and execute it:

    Open Extensions Folder

  3. Inside the folder that just opened, navigate to the folder:

    gimly81.matlab-2.2.0

  4. Open a terminal there, and type in it:

    npm install

  5. Wait for that to finish, and restart VSCode.

From what I could tell, this is an issue with the bundling of the new dependency vscode-textmate-languageservice.

When VSCode tries to activate the extension it encounters the following error:

[2021-10-18 17:44:49.458] [exthost] [info] ExtensionService#_doActivateExtension Gimly81.matlab, startup: false, activationEvent: 'onLanguage:matlab' [2021-10-18 17:44:49.458] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/USERNAME/.vscode/extensions/gimly81.matlab-2.2.0/out/src/extension [2021-10-18 17:44:49.465] [exthost] [error] Activating extension Gimly81.matlab failed due to an error: [2021-10-18 17:44:49.465] [exthost] [error] Error: Cannot find module 'vscode-textmate-languageservice'`

However, I do not think that this is an issue with esbuild configuration. Because it does seem like it's bundling the module. When the --analyze option is added to the esbuild-base script, it outputs the following:

out/main.js 712.3kb 100.0% ├ node_modules/vscode-textmate/release/main.js 100.6kb 14.1% ├ node_modules/iconv-lite/encodings/tables/cp936.json 88.6kb 12.4% ├ node_modules/iconv-lite/encodings/tables/cp950.json 81.8kb 11.5% ├ node_modules/iconv-lite/encodings/tables/eucjp.json 79.3kb 11.1% ├ node_modules/iconv-lite/encodings/tables/cp949.json 71.0kb 10.0% ├ node_modules/iconv-lite/encodings/sbcs-data-generated.js 60.5kb 8.5% ├ node_modules/iconv-lite/encodings/tables/shiftjis.json 45.8kb 6.4% ├ node_modules/iconv-lite/encodings/tables/big5-added.json 35.8kb 5.0% ├ node_modules/vscode-oniguruma/release/main.js 20.1kb 2.8% ├ node_modules/iconv-lite/encodings/dbcs-codec.js 16.1kb 2.3% ├ node_modules/iconv-lite/encodings/utf32.js 7.7kb 1.1% ├ node_modules/iconv-lite/encodings/utf7.js 7.3kb 1.0% ├ node_modules/vscode-textmate-languageservice/out/src/workspaceSymbolProvider.js 7.1kb 1.0% ├ node_modules/iconv-lite/encodings/sbcs-data.js 6.8kb 1.0% ├ node_modules/vscode-textmate-languageservice/out/src/textmateEngine.js 5.7kb 0.8% ├ node_modules/vscode-textmate-languageservice/out/src/foldingProvider.js 5.0kb 0.7% ├ node_modules/iconv-lite/encodings/internal.js 4.9kb 0.7% ├ node_modules/iconv-lite/lib/index.js 4.7kb 0.7% ├ node_modules/iconv-lite/encodings/utf16.js 4.5kb 0.6% ├ node_modules/vscode-textmate-languageservice/out/src/util/registryResolver.js 4.2kb 0.6% ├ node_modules/vscode-textmate-languageservice/out/src/peekDefinitionProvider.js 4.0kb 0.6% ├ src/extension.ts 4.0kb 0.6% ├ node_modules/vscode-textmate-languageservice/out/src/tableOfContentsProvider.js 3.8kb 0.5% ├ node_modules/iconv-lite/encodings/dbcs-data.js 3.7kb 0.5% ├ src/mlintErrors.ts 3.2kb 0.4% ├ node_modules/vscode-textmate-languageservice/out/src/documentSymbolProvider.js 3.2kb 0.4% ├ node_modules/iconv-lite/lib/streams.js 3.0kb 0.4% ├ node_modules/iconv-lite/encodings/tables/gb18030-ranges.json 2.7kb 0.4% ├ node_modules/safer-buffer/safer.js 2.3kb 0.3% ├ node_modules/iconv-lite/encodings/tables/gbk-added.json 2.2kb 0.3% ├ node_modules/find-up/index.js 2.2kb 0.3% ├ node_modules/iconv-lite/encodings/sbcs-codec.js 2.0kb 0.3% ├ src/matlabDiagnostics.ts 1.9kb 0.3% ├ node_modules/locate-path/index.js 1.7kb 0.2% ├ node_modules/p-limit/index.js 1.5kb 0.2% ├ node_modules/iconv-lite/lib/bom-handling.js 1.2kb 0.2% ├ node_modules/p-locate/index.js 1.2kb 0.2% ├ node_modules/yocto-queue/index.js 1.1kb 0.2% ├ node_modules/vscode-textmate-languageservice/out/src/util/onigLibs.js 1.1kb 0.2% ├ node_modules/vscode-textmate-languageservice/out/src/util/dispose.js 1.0kb 0.1% ├ node_modules/vscode-textmate-languageservice/out/src/util/lazy.js 782b 0.1% ├ node_modules/vscode-textmate-languageservice/out/src/index.js 724b 0.1% ├ node_modules/iconv-lite/encodings/index.js 645b 0.1% ├ node_modules/path-exists/index.js 552b 0.1% ├ node_modules/pkg-dir/index.js 520b 0.1% └ node_modules/vscode-textmate-languageservice/out/src/util/file.js 389b 0.1%

And as can be seen in the log, there are multiple entries that mention files from vscode-textmate-languageservice.

I hope this helps with fixing the issue.

rlivings39 commented 3 years ago

@Gimly , it looks the extension hard errors on every load w/ version 2.20 because of this missing dependency. Syntax highlighting gets loaded but downstream things break. Any ETA on a fix for this?

Gimly commented 3 years ago

Last couple of weeks were a little crazy and I wasn't able to work on that. I'm not so sure about this week either. I'll do my best. Really sorry.

rlivings39 commented 3 years ago

@SNDST00M any thoughts on what may be going wrong here? The missing dependency is your new vscode-textmate-languageservice so any insight would be appreciated. Maybe there's something special about how it should be depended on?

ghost commented 3 years ago

I don't believe so, and I'm also unable to reproduce

rlivings39 commented 3 years ago

Curious. If you open the Output window and go to "Log (Extension Host)" and scroll around, you don't see the errors that @mjdshibly reported?

I reliably see those. Syntax highlighting works, but the other providers are then broken. Some other folks I work with have reported similar issues.

mjdshibly commented 3 years ago

@SNDST00M Did you make sure that your installation of the extension is completely clean, and that you're not running the development version in an Extension Host window? You might also want to try opening the installation folder for VSCode extensions, and manually deleting the extension's folder. Maybe VSCode does not clean everything up when doing a normal extension uninstallation and what sticks around prevents the error from reproducing for you.

ghost commented 3 years ago

Happened when I deleted the gimly81.matlab folder. There isn't actually a node_modules folder post-installation, hence the issue.

ghost commented 3 years ago

https://github.com/Gimly/vscode-matlab/blame/d3b5845636a4b308539adea5e7d44f9956047a78/.vscodeignore#L11

This should be generated using npm list -parseable -depth 0 -dev true or left out (as VSCE is meant to work with a bundler like webpack).

https://github.com/SNDST00M/vscode-native-svg-preview/blob/v1.60.2/package.json#L201-L204

Gimly commented 3 years ago

I've pushed a new version which should hopefully fix that issue. Reopening until I have confirmation it is indeed fixed.

Nowlinsuk commented 3 years ago

I've pushed a new version which should hopefully fix that issue. Reopening until I have confirmation it is indeed fixed.

I'm glad to see this new version has fixed the bugs recently mentioned, but "Peek Defination" still cannot work when I put the function into the same folder. It says "No definition found".

ghost commented 3 years ago

Something's gone catastrophically wrong in the TM-based language service again.

  ERR Unable to read file '%APPDATA%\Roaming\Code\User\globalStorage' (Error: Unable to read file '%APPDATA%\Roaming\Code\User\globalStorage' that is actually a directory): EntryIsADirectory (FileSystemError): Unable to read file '%APPDATA%\Roaming\Code\User\globalStorage' (Error: Unable to read file '%APPDATA%\Roaming\Code\User\globalStorage' that is actually a directory)
    at _handleError (%APPDATA%\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:164071)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

In the backend it reads off the document symbol provider just like the "go to symbol" feature. Those two providers work, so I'll have to debug.

ghost commented 3 years ago

I found the problem and I'm planning a new release to fix it. I am also hammering together a test suite so this doesn't repeat itself.

image

ghost commented 3 years ago

Good news, I have made a breakthrough with the testing and will have this out by tomorrow.

Unexplained regression, the 0.2.0 release of the LSP is delayed indefinitely I guess.

Now fixed! Full steam ahead with a publish definitely coming soon™

ghost commented 2 years ago

Hi these issues have been addressed in the latest version! Please notify us if not

zm-cttae-archive commented 1 year ago

174 allows us to officially use the bundler again.. In particular we have the confidence that we are not depending on Node modules or modules invoked from VS Code itself (which the core team have actively endeavoured to prevent etxdevs from using).