dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.8k stars 374 forks source link

Snippet IntelliSense in vs code extension Polyglot Notebooks #3357

Open Nick135 opened 7 months ago

Nick135 commented 7 months ago

Is your feature request related to a problem? Please describe. The C# extension for vs code includes IntelliSense (Write code with auto-completion), which is very helpful. I also prefer to have IntelliSense in Polyglot Notebooks C#.

Polyglot Notebooks: image

Text File C# Language: image image

Describe the solution you'd like Polyglot Notebooks also support auto-completion for e.g. loops

jonsequitur commented 7 months ago

Intellisense is available in C# in Polyglot Notebooks. You seem to have hit a bug of some kind.

The steps here to make sure you have all pending updates installed might resolve it: https://github.com/dotnet/interactive/blob/main/docs/FAQ.md#troubleshooting

Could you provide information about:

Thanks.

Nick135 commented 7 months ago

@jonsequitur I have the same behavior on different PCs.

Polyglot Notebooks v1.0.4562010

VS Code

Version: 1.84.2 (user setup)
Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
Date: 2023-11-09T10:51:52.184Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

dotnet --info


.NET SDK:
 Version:   7.0.403
 Commit:    142776d834

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.403\

Host:
  Version:      7.0.13
  Architecture: x64
  Commit:       3f73a2f186

.NET SDKs installed:
  5.0.412 [C:\Program Files\dotnet\sdk]
  7.0.403 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download```
Nick135 commented 7 months ago

Same result with v1.0.4601011 Pre-Release

dotnet --info

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.6c33ef20

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

Installierte .NET-Workloads:
 Workload version: 8.0.100-manifests.6c33ef20
Es sind keine installierten Workloads zum Anzeigen vorhanden.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  5.0.412 [C:\Program Files\dotnet\sdk]
  7.0.403 [C:\Program Files\dotnet\sdk]
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
jonsequitur commented 7 months ago

We just released a new version that targets .NET 8. Please make sure you have the .NET 8 SDK installed and the latest versions of VS Code and Polyglot Notebooks and let me know if the issue is still present.

Nick135 commented 7 months ago

@jonsequitur Same behavior with the new version.. (v1.0.4606020 current)

Adam-S-Daniel commented 6 months ago

Same here, and also no Intellisense or syntax highlighting in Powershell cells. I am wondering whether this could share a root cause with https://github.com/microsoft/vscode/issues/199606, because my VS Code search has also regressed-- it fails to give results and instead shows "No provider registered for view type: 'polyglot-nortebook-window'".

Polyglot Notebooks v1.0.4606020

microsoft.dotnet-interactive 1.0.460602

VS Code:

Version: 1.85.0 (user setup) Commit: af28b32d7e553898b2a91af498b1fb666fdebe0c Date: 2023-12-06T20:48:09.019Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

From OUTPUT -> Polyglot Notebook : logger:

[Error] extension host: Error loading grammar for scope source.polyglot-notebook.pwsh: no grammar found

[Error] extension host: Error getting tokens for notebook untitled:Untitled-1.dib?polyglot-notebook: Error: No grammar provided for

[Error] extension host: Error loading grammar for scope source.yaml: no grammar found

[Error] extension host: Error loading grammar for scope text.html.derivative: no grammar found

[Error] extension host: Error loading grammar for scope source.css: no grammar found

[Error] extension host: Error loading grammar for scope text.html.basic: no grammar found

[Error] extension host: Error loading grammar for scope source.ini: no grammar found

[Error] extension host: Error loading grammar for scope source.java: no grammar found

[Error] extension host: Error loading grammar for scope source.lua: no grammar found

[Error] extension host: Error loading grammar for scope source.makefile: no grammar found

[Error] extension host: Error loading grammar for scope source.perl: no grammar found

[Error] extension host: Error loading grammar for scope source.r: no grammar found

[Error] extension host: Error loading grammar for scope source.ruby: no grammar found

[Error] extension host: Error loading grammar for scope source.php: no grammar found

[Error] extension host: Error loading grammar for scope source.sql: no grammar found

[Error] extension host: Error loading grammar for scope source.asp.vb.net: no grammar found

[Error] extension host: Error loading grammar for scope text.xml: no grammar found

[Error] extension host: Error loading grammar for scope text.xml.xsl: no grammar found

[Error] extension host: Error loading grammar for scope source.batchfile: no grammar found

[Error] extension host: Error loading grammar for scope source.clojure: no grammar found

[Error] extension host: Error loading grammar for scope source.coffee: no grammar found

[Error] extension host: Error loading grammar for scope source.c: no grammar found

[Error] extension host: Error loading grammar for scope source.cpp: no grammar found

[Error] extension host: Error loading grammar for scope source.diff: no grammar found

[Error] extension host: Error loading grammar for scope source.dockerfile: no grammar found

[Error] extension host: Error loading grammar for scope text.git-commit: no grammar found

[Error] extension host: Error loading grammar for scope text.git-rebase: no grammar found

[Error] extension host: Error loading grammar for scope source.go: no grammar found

[Error] extension host: Error loading grammar for scope source.groovy: no grammar found

[Error] extension host: Error loading grammar for scope text.pug: no grammar found

[Error] extension host: Error loading grammar for scope source.js: no grammar found

[Error] extension host: Error loading grammar for scope source.js.regexp: no grammar found

[Error] extension host: Error loading grammar for scope source.json: no grammar found

[Error] extension host: Error loading grammar for scope source.json.comments: no grammar found

[Error] extension host: Error loading grammar for scope source.css.less: no grammar found

[Error] extension host: Error loading grammar for scope source.objc: no grammar found

[Error] extension host: Error loading grammar for scope source.swift: no grammar found

[Error] extension host: Error loading grammar for scope source.css.scss: no grammar found

[Error] extension host: Error loading grammar for scope source.perl.6: no grammar found

[Error] extension host: Error loading grammar for scope source.powershell: no grammar found

[Error] extension host: Error loading grammar for scope source.python: no grammar found

[Error] extension host: Error loading grammar for scope source.julia: no grammar found

[Error] extension host: Error loading grammar for scope source.regexp.python: no grammar found

[Error] extension host: Error loading grammar for scope source.rust: no grammar found

[Error] extension host: Error loading grammar for scope source.scala: no grammar found

[Error] extension host: Error loading grammar for scope source.shell: no grammar found

[Error] extension host: Error loading grammar for scope source.ts: no grammar found

[Error] extension host: Error loading grammar for scope source.tsx: no grammar found

[Error] extension host: Error loading grammar for scope source.cs: no grammar found

[Error] extension host: Error loading grammar for scope source.fsharp: no grammar found

[Error] extension host: Error loading grammar for scope source.dart: no grammar found

[Error] extension host: Error loading grammar for scope text.html.handlebars: no grammar found

[Error] extension host: Error loading grammar for scope text.log: no grammar found

[Error] extension host: Error loading grammar for scope source.erlang: no grammar found

[Error] extension host: Error loading grammar for scope source.elixir: no grammar found

[Error] extension host: Error loading grammar for scope text.tex.latex: no grammar found

[Error] extension host: Error loading grammar for scope text.bibtex: no grammar found

[Error] extension host: Error loading grammar for scope source.twig: no grammar found

Nick135 commented 5 months ago

@jonsequitur Any news about this bug?

Nick135 commented 1 month ago

?

jonsequitur commented 1 month ago

I'm not able to reproduce this bug without more information. Could you include a screenshot of the entire VS Code window when this is happening?

Nick135 commented 3 weeks ago

@jonsequitur : image

jonsequitur commented 3 weeks ago

The issue looks like it refers specifically to snippets. Polyglot Notebooks doesn't ship with custom snippets but we could potentially make the available ones from various languages show up in notebooks. The language identifiers are different so it will take a little research.

In the meantime though you can create custom snippets for e.g. dotnet-interactive.csharp.