Skip to content

Commit fd7d391

Browse files
refactor(Cocoon): Enhance VS Code shim with structural methods and singular provider names
Improve the VS Code Position and Range shims passed to language providers with structural methods that extensions expect: - Position now has isBefore/isBeforeOrEqual/isAfter/isAfterOrEqual/isEqual/compareTo/translate/with/toString - Range now has isEmpty/isSingleLine/contains/isEqual/intersection/union/with Add proper language ID detection based on file extension mapping (rs→rust, ts/tsx→typescript, js/jsx→javascript, json/toml/md/py/go→respective languages). Enhance TextDocument shim with missing members: uri scheme/path, fileName without file:// prefix, isClosed, eol, proper lineAt handling for position objects, and save method. Add support for singular method name variants that Mountain sends ($provideCompletion, $provideCodeAction, $provideDocumentHighlight, $provideDocumentSymbol, $provideWorkspaceSymbol, $provideDocumentFormatting, $provideDocumentRangeFormatting, $provideRename, $provideFoldingRange, $provideInlayHint, $provideCodeLens) in addition to the plural forms. This ensures VS Code extensions that rely on Position/Range structural methods and various provider method names work correctly with the Cocoon language provider registry.
1 parent 4e1316c commit fd7d391

1 file changed

Lines changed: 223 additions & 56 deletions

File tree

0 commit comments

Comments
 (0)