customdiagnostics READMECustom diagnostics allows to define your own diagnostics to show them in problems panel. These diagnostics FeaturesThis extension provides a way to define a diagnostic and a replace rule in a file. Then you set the file path in extension settings, in property "JAMDiagnosticsFile". You can set in this file with replacing rules and rulesets this way:
The properties of a replacing rule have the following meaning:
There is another powerful but complex way to set a replacing rule: instead of replaceExpression parameter, you can set a javascript function in a module. You can set the rule this way:
instead of replaceExpression parameter, you can set a javascript function in a module. You can set the rule this way:
The example of the module is in the folder "jsReplaceExampleModules". For further information about how to make a function to replace a regular expression match, you can chech this link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace For helping you to make rules and rulesets, you can use the following snippets:
With command "JAM Custom Rules. Pick a ruleset and apply replacements in all workspace documents" we can pick a ruleset from the list and replace all occurrences in all documents. FixesFixes is a subtle way to do replacements. The replacement will be done only if the line has a problem, with an error code. You can set a fix this way:
The meaning: the replacing will be applied only if the line has a problem with code "AL0223", in problems panel. Bellow you can configure a set of fixes and aplly them in all workspace documents with the command "JAM Fixes. Pick a fixset and apply fixes in all workspace documents diagnostics". Then you choose a fixset if you are more than one, and will apply all fixes in all documents. DiagnosticsIn the same file we set the replacing rules we can set a digsnotics to find and show in problems panel.
The properties of a rule have the following meaning:
Note: You only will see custom diagnostics out of the document edition setting the extension parameter Steps to set the diagnostics
Requirementsvscode Extension SettingsThis extension contributes the following settings:
Known IssuesOnly shows custom diagnostics in problems panel, if you open the text document in your editor. I am thinking to do or not other way due performanece issues. So not sure this will be an issue or not. Release Notes0.0.1The beta with replacement rules and diagnostics when you open the document. Image creative common icon image from: https://uxwing.com/find-and-replace-icon/ 0.0.2Change description of the extension. 0.0.3Issue reading settings, can not execute replacing. 0.0.4Separate replace rules and rulesets from diagnostics. 0.0.5Fixing replace rules 0.0.6fileExtension property in ruleset 0.0.7Optimization and progress bar 0.0.8Multi-line search and replacement 0.0.9Apply fixes. 0.0.10Showing fixes in quick fix. 0.0.11Appliying javascript modules in replacements. 0.0.12Fixing issues with replacing by empty string. 0.0.13Activation events for language json. 0.0.14Issue with search with negative clauses 0.0.15Able to set one or more aditional rule files with settings property "JAMDiagnostics.AdditionalFilePaths". This setting will load as rules, diagnostics and fixes as you need been able to separate files to ease the configuration. 0.0.16Error fixed: Command 'JAM Custom Rules. Pick a ruleset and apply replacements in all workspace documents' resulted in an error (command 'JAMCustomRuls.replaceAllRulesInAllDocuments' not found) 0.0.17Some errors in snippets, dianostics instead diagnostics. More control of diagnostics errors. 0.0.18Only check diagnostics in configured language 0.0.19Fix without traking 0.0.20Apply bulk fixes. 0.0.21Dependencies minimatch 0.0.22Can use functions in fixes too, not only in replacements. 0.0.23Check searchExpresion is filled. 0.0.24New property in diagnostics skipFromSearchIfMatch. You can fill a regex in this property, to set an exclusion from the diagnostic. This way you can avoid complex negative clauses to set these exclusions. 0.0.25Error in diagnostics in all workspace: errors quit the output panel when you close the document. |