Closed Matt-Robinson closed 1 year ago
Please share a self contained code sample that demonstrates the issue
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
Please share a self contained code sample that demonstrates the issue
Hi @mjbvz,
I cannot recreate this by simply creating classes, but I can demonstrate the issue by way of a screen recording. It is attached. You'll need to unzip it. It is an MP4 file.
First I highlight that the Class name is not green in the body of the code when it is instantiated. I attempt to use F12 to go to that method being used - it fails. I then scroll to the Class import and show it is also not green. I then add a single space at the end of a line above it. I show the class name have now turned green. I scroll back to the body of the code, note the Class name is now green here. I show I can now use the F12 key successfully.
My Visual Code details are: Version: 1.79.2 (system setup) Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:57:04.379Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621 VisualStudioEditorClassFail.zip
Type: Bug
It seems if you have a class (e,g. AgentActivity) which extends another class (e.g., Activity) and you import the extended class (AgentActivity) into JS code, the editor initially fails to recognize the class as a class object until a change is made above the import, even if the change is to retype a colon. Once the change is made, the class import turns green and it's methods are recognized in the body of the code. This only lasts until the JS code file is reloaded for editing at some later time, whereupon the same problem recurs every time.
Sample code segment:
Note: AgentActivity extends Activity but shows in blue, and any attempt to use F12 (go to definition) on any of its methods results in a 'No Definition found for xxx' error. The rest of the classes are the correct green.
If I retype the colon or make any textual change in any line above the AgentActivity include, it turns green and its methods are now recognized in the JS code referencing it.
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: Yes
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz (12 x 2592)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.79GB (12.96GB free)| |Process Argv|--crash-reporter-id 0d2f66ee-101b-4d7e-946b-87ab844b5438| |Screen Reader|no| |VM|50%|
Extensions (19)
Extension|Author (truncated)|Version ---|---|--- cform|aws|0.0.24 vscode-eslint|dba|2.4.0 vscode-firefox-debug|fir|2.9.8 cloudcode|goo|1.21.5 vscode-docker|ms-|1.25.1 vscode-kubernetes-tools|ms-|1.3.11 remote-containers|ms-|0.292.0 remote-wsl|ms-|0.78.9 live-server|ms-|0.4.8 java|red|1.19.0 vscode-yaml|red|1.13.0 snyk-vulnerability-scanner|sny|1.20.2 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 vscode-java-debug|vsc|0.51.0 vscode-java-dependency|vsc|0.23.0 vscode-java-pack|vsc|0.25.11 vscode-java-test|vsc|0.39.0 vscode-maven|vsc|0.41.0A/B Experiments
``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 3biah626:30602489 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 7ij38806:30736111 pythonfmttext:30731395 pythoncmvfstrcf:30756944 fixshowwlkth:30730052 hidesbindicator:30730055 pythongtdpathcf:30739705 ```