Skip to content
Closed

. #1817

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@
},
"swift.diagnosticsCollection": {
"type": "string",
"default": "keepSourceKit",
"default": "onlySwiftc",
"markdownDescription": "Controls how diagnostics from the various providers are merged into the collection of `swift` errors and warnings shown in the Problems pane.",
"enum": [
"onlySwiftc",
Expand Down
2 changes: 1 addition & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ const configuration = {
get diagnosticsCollection(): DiagnosticCollectionOptions {
return vscode.workspace
.getConfiguration("swift")
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "keepSourceKit");
.get<DiagnosticCollectionOptions>("diagnosticsCollection", "onlySwiftc");
},
/** set the -diagnostic-style option when running `swift` tasks */
get diagnosticsStyle(): DiagnosticStyle {
Expand Down
1 change: 1 addition & 0 deletions src/sourcekit-lsp/LanguageClientConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class LanguagerClientDocumentSelectors {
{ scheme: "sourcekit-lsp", language: "swift" },
{ scheme: "file", language: "swift" },
{ scheme: "untitled", language: "swift" },
{ scheme: "fba", language: "swift" },
{ scheme: "file", language: "objective-c" },
{ scheme: "untitled", language: "objective-c" },
{ scheme: "file", language: "objective-cpp" },
Expand Down
8 changes: 8 additions & 0 deletions src/sourcekit-lsp/uriConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import * as vscode from "vscode";

export const uriConverters = {
protocol2Code: (value: string): vscode.Uri => {
if (value.startsWith("fba:")) {
// SourceKit-LSP does not support non-file schemes, so we need to convert it.
return vscode.Uri.file(vscode.Uri.parse(value).fsPath);
}
if (!value.startsWith("sourcekit-lsp:")) {
// Use the default implementation for all schemes other than sourcekit-lsp, as defined here:
// https://github.com/microsoft/vscode-languageserver-node/blob/14ddabfc22187b698e83ecde072247aa40727308/client/src/common/protocolConverter.ts#L286
Expand Down Expand Up @@ -69,6 +73,10 @@ export const uriConverters = {
});
},
code2Protocol: (value: vscode.Uri): string => {
if (value.scheme === "fba") {
// SourceKit-LSP does not support non-file schemes, so we need to convert it.
return vscode.Uri.file(value.fsPath).toString();
}
if (value.scheme !== "sourcekit-lsp") {
// Use the default implementation for all schemes other than sourcekit-lsp, as defined here:
// https://github.com/microsoft/vscode-languageserver-node/blob/14ddabfc22187b698e83ecde072247aa40727308/client/src/common/codeConverter.ts#L155
Expand Down