Closed
Description
We often have code examples in DartDoc. They get out of sync with the actual code very easily, and are harder to read because they aren't syntax highlighted. It would be really nice if the editor could recognize code fragments in DartDoc comments and do syntax highlighting and error checking on them. There are already mechanisms that DartDoc uses to indicate code fragments, so this ought to be recognizable. There might be an issue with needing to recognize that this code isn't actually part of the file, as it might break, or two different code fragments might define a function with the same name, so each needs to be treated somewhat separately, and not compiled as part of the file. But it would be really really nice.