Skip to content

Commit 57a6978

Browse files
authored
Only change scheme of .swiftinterface files to readonly if old scheme was file (#1276)
I’m working on adding semantic functionality to generated interfaces in SourceKit-LSP and this will generate reference documents with a `sourcekit-lsp:` scheme and a `.swiftinterface` file. We shouldn’t change those URIs to a `readonly` scheme.
1 parent eb2e521 commit 57a6978

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sourcekit-lsp/LanguageClientManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ export class LanguageClientManager implements vscode.Disposable {
538538
const definitions = result as vscode.Location[];
539539
if (
540540
definitions &&
541-
path.extname(definitions[0].uri.path) === ".swiftinterface"
541+
path.extname(definitions[0].uri.path) === ".swiftinterface" &&
542+
definitions[0].uri.scheme === "file"
542543
) {
543544
const uri = definitions[0].uri.with({ scheme: "readonly" });
544545
return new vscode.Location(uri, definitions[0].range);

0 commit comments

Comments
 (0)