Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR replaces a custom uriToPath function with the standard ls.DocumentUriToFilename function to improve Windows compatibility for URI-to-file-path conversion in the LSP server implementation.
Key changes:
- Replaces custom URI parsing logic with the TypeScript-Go library's built-in function
- Comments out unused function declarations in the shim layer
- Updates function signatures to use proper
lsproto.DocumentUritypes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
shim/ls/shim.go |
Comments out unused function declarations and maintains the DocumentURIToFileName export |
go.mod |
Adds dependency on github.com/microsoft/typescript-go/shim/ls module |
cmd/rslint/lsp.go |
Replaces custom uriToPath implementation with ls.DocumentURIToFileName and updates call sites |
| type Definition = ls.Definition | ||
| //go:linkname DeprecateSortText github.com/microsoft/typescript-go/internal/ls.DeprecateSortText | ||
| func DeprecateSortText(original ls.sortText) ls.sortText | ||
| ////go:linkname DeprecateSortText github.com/microsoft/typescript-go/internal/ls.DeprecateSortText |
There was a problem hiding this comment.
The comment syntax is inconsistent. Use // instead of //// for commenting out the go:linkname directive.
| ////go:linkname DeprecateSortText github.com/microsoft/typescript-go/internal/ls.DeprecateSortText | |
| //go:linkname DeprecateSortText github.com/microsoft/typescript-go/internal/ls.DeprecateSortText |
| func FileNameToDocumentURI(fileName string) lsproto.DocumentUri | ||
| //go:linkname GetCompletionItemData github.com/microsoft/typescript-go/internal/ls.GetCompletionItemData | ||
| func GetCompletionItemData(item *lsproto.CompletionItem) (*ls.itemData, error) | ||
| ////go:linkname GetCompletionItemData github.com/microsoft/typescript-go/internal/ls.GetCompletionItemData |
There was a problem hiding this comment.
The comment syntax is inconsistent. Use // instead of //// for commenting out the go:linkname directive.
| ////go:linkname GetCompletionItemData github.com/microsoft/typescript-go/internal/ls.GetCompletionItemData | |
| //go:linkname GetCompletionItemData github.com/microsoft/typescript-go/internal/ls.GetCompletionItemData |
| func NewLanguageService(host ls.Host) *ls.LanguageService | ||
| //go:linkname NewSymbolAndEntries github.com/microsoft/typescript-go/internal/ls.NewSymbolAndEntries | ||
| func NewSymbolAndEntries(kind ls.definitionKind, node *ast.Node, symbol *ast.Symbol, references []*ls.referenceEntry) *ls.SymbolAndEntries | ||
| ////go:linkname NewSymbolAndEntries github.com/microsoft/typescript-go/internal/ls.NewSymbolAndEntries |
There was a problem hiding this comment.
The comment syntax is inconsistent. Use // instead of //// for commenting out the go:linkname directive.
| ////go:linkname NewSymbolAndEntries github.com/microsoft/typescript-go/internal/ls.NewSymbolAndEntries | |
| //go:linkname NewSymbolAndEntries github.com/microsoft/typescript-go/internal/ls.NewSymbolAndEntries |
use ls.DocumentUriToFilename for UriToPath for better windows compat