Skip to content

Internal PHP Validation Provider uses a problematic value for endCharacter #196167

@zobo

Description

@zobo

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.83.1 (user setup) f1b07bd
  • OS Version: Windows_NT x64 10.0.22621

When the internal PHP Valudation Provider is enabled "php.validate.enable": true it is reporting Diagnostics with a Range end Character value of Number.MAX_VALUE.
https://github.com/microsoft/vscode/blob/c05b49710b0fff24aa4380751e02b53c54e784ce/extensions/php-language-features/src/features/validationProvider.ts#L200C6-L200C6

This causes other language servers to get a message textDocument/codeAction with the value of 1.7976931348623157e+308.

Steps to Reproduce:

  1. Create PHP file, create a line with an error.
  2. Have some PHP language server and inspect LSP communication

Additional info:
LSP defines that position should use type uinteger https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position that is supposed to be 0 to 2^31 - 1 https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uinteger

Perhaps a better solution than fixing each location that uses Number.MAX_VALUE in VSCode - and possible other extensons - would be to catch this where LSP messages are generated and sent to individual Language Servers.

Fix for internal PHP Valudation Provider is in #196166

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions