DEVSENSE / phptools-docs

PHP Tools public content
Apache License 2.0
75 stars 9 forks source link

Urlencode/decode issue in Language server. #568

Open tanzanite777 opened 1 month ago

tanzanite777 commented 1 month ago

Type: Bug

While trying to pin down an annoying bug (x_x, not related to this report) with static code analysis - discovered a minor bug (have encountered the same bug in another plugin - seems to be a popular oversight). Not clear who mangled the filename - but since it manifests within this extension then that is a good starting point.

Language server attempts to open mangled filenames (ex: actual file name "2^%%5B^5BE^5BE7E354%%59.php.php" at some point becomes "2^%[^5BE^5BE7E354%Y.php.php" - which it consequently fails to open):

-- messages in PHP Language Server output
[Error - 9:43:28 AM] File file:///c:/<snip>/templates_c/2^%[^5BE^5BE7E354%Y.php.php could not be read.

That should not happen.

PS. That folder probably should not be checked anyway and i added it to excluded list. So, not a problem for me and quite unlikely to cause significant problems to anyone else - probably still worth taking a look.

Extension version: 1.47.15512 VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 3600)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.88GB (4.96GB free)| |Process Argv|--crash-reporter-id adf79977-8c83-4303-918e-a7dfc5f31bf1| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31062275 showvideot:31016892 chatpanelc:31048052 dsvsc021:30996838 bdiig495:31013172 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31061160 pythonprt:31056678 dwnewjupyter:31046869 fa862199:31048878 ```
jakubmisek commented 1 month ago

The latest pre-release fixes the parsing and some other related issues.

Navigating (go-to-def) is still broken because VSC somehow double-encodes the URI.