FHIR / vscode-fsh

A Visual Studio Code language extension for FHIR Shorthand (FSH)
Apache License 2.0
18 stars 3 forks source link

Syntax highlight fixes for quoted codes and aliases after keywords #73

Closed jafeltra closed 6 months ago

jafeltra commented 6 months ago

Fixes #72

This PR fixes the issue reported in #72. With the current version of the extension, having a coding with a system that uses an alias and a code that has spaces does not highlight correctly. With this branch, the following rule no longer breaks the syntax highlighting for the rest of the file:

* valueCodeableConcept = $test#"example code"

I also made a bonus update to an issue that I saw recently. When using an Alias that starts with $ after a FSH keyword, it wasn't highlighted. If this shouldn't have been highlighted, I can revert this change. With this branch, the following keyword highlight as expected:

InstanceOf: $ServiceRequest

I checked and neither of these issues appear on FSH Online because it uses slightly different syntax highlighting.

I also ran an npm audit fix and committed those changes, and I had to update the @vscode/test-electron dependency to get the tests to run again.

jafeltra commented 6 months ago

Alrighty, I was tempted to say we don't care, but really I did care. I think that pattern of mismatched highlighting has actually been around for a long time, but I think I found a pretty easy way to address it. I did two things to get the highlighting to be consistent:

image

image