-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize draft not aware diagnostics for getRelatedListRecords and getRelatedListCount #147
Changes from 2 commits
349fb6a
3fb6cc4
de2e41c
f575ea9
edd4943
0afdcd1
ad25666
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,15 +143,16 @@ documents.onDidClose((e) => { | |
}); | ||
|
||
connection.languages.diagnostics.on(async (params) => { | ||
const document = documents.get(params.textDocument.uri); | ||
if (document !== undefined) { | ||
const uri = params.textDocument.uri; | ||
const document = documents.get(uri); | ||
|
||
// Do diagnostics if document is under LWC folder and already in cache. | ||
if (uri.indexOf(WorkspaceUtils.LWC_PATH) > 0 && document !== undefined) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only do diagnostics for file under lwc folder |
||
return { | ||
kind: DocumentDiagnosticReportKind.Full, | ||
items: await validateDocument(settings, document, extensionTitle) | ||
} satisfies DocumentDiagnosticReport; | ||
} else { | ||
// We don't know the document. We can either try to read it from disk | ||
// or we don't report problems for it. | ||
return { | ||
kind: DocumentDiagnosticReportKind.Full, | ||
items: [] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,10 +45,5 @@ export async function validateDocument( | |
results = results.concat(diagnostics); | ||
} | ||
|
||
// Set the source for diagnostic source. | ||
results.forEach((diagnostic) => { | ||
diagnostic.source = extensionName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious, why did you get rid of this? I wasn't a fan of this post processing anyway so removing it is a welcome change but where is the source set now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The vscode has its own brain where and how to render the diagnostic attributes. I like to render the diagnostic.source "Salesforce Mobile Extension in ui so to tell developer where this diagnostic is from. When we try to render a link in diagnostic pop up like what Kevin wants. the source is rendered between the msg and cde/codeDescription like below. Totally messed up the effect we want. Removing the source makes the popup close to what we want. Source will not be set if we will render the link. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To make myself clear, I wasn't the fan of post processing, so removing is fine I think. But do what you think is the best thing to do. |
||
}); | ||
|
||
return results; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diagnostic renders code and codeDescription as link