oleg-shilo / cs-script.vscode

VSCode extension for CS-Script
MIT License
37 stars 7 forks source link

Auto-completion defect for nuget packages #28

Closed ZmorzynskiK closed 1 year ago

ZmorzynskiK commented 2 years ago

It looks like intellisense in VS Code does not work for packages imported using //css_nuget directive. For example with //css_nuget Newtonsoft.Json;, the intellisense does not work for types from this nuget. I see it's referenced in the "CS-Script - Active" pane and the general C# intellisense from Omnisharp works OK.

Or maybe I have some configuration issues?

VS Code version:

Version: 1.61.0 (system setup)
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:11:57.396Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT ia32 10.0.19042

CS-Script version:

CS-Script.VSCode - v2.0.1
-------------------------------------------------------
C# Script execution engine (.NET Core). Version 4.1.0.0.
Copyright (C) 2004-2020 Oleg Shilo. www.csscript.net (github.com/oleg-shilo/cs-script.core)

   CLR:             5.0.10
   System:          Microsoft Windows NT 10.0.19042.0
   Architecture:    x64
   Install dir:     
   Script engine:   C:\Users\admin\AppData\Roaming\Code\User\cs-script.user\dotnet\cscs.dll
   Config file:     
   Compiler engine: dotnet (C:\Program Files\dotnet\dotnet.exe)
   NuGet manager:   dotnet
   NuGet cache:     C:\Users\admin\.nuget\packages
   Custom commands: C:\ProgramData\cs-script\commands
   Global includes: C:\ProgramData\cs-script\inc
-------------------------------------------------------
Syntaxer
   C:\Users\admin\AppData\Roaming\Code\User\cs-script.user\dotnet\syntaxer\syntaxer.dll
Extension
   c:\Users\admin\.vscode\extensions\oleg-shilo.cs-script-2.0.1\out

oleg-shilo commented 2 years ago

Sorry, it took so long to get me to look at this. I was busy clearing the backlog for my other projects and extensions.

Yes, it is a problem as cs-script does manage nuget packages but simply "asks" dotnet to do that. Thus syntaxer, which relies on cs-script is not aware of any packages being omported.

I will have a look at Notepad++ extension where this problem is solved image

Interesting enough VSCode itself picks autocompletion well for the packages it can find: image

oleg-shilo commented 2 years ago

My mistake. It looks like the latest extension update has patched the syntaxer so it picks nuget packages exactly as in Notepad++.

Meaning that the screenshot of VSCode above is in fact the extension autocompletion working (not the default VSCode syntax provider).

Now I understand why this issue is closed :)