Skip to content
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

Highlighting and error checking in Dartdoc code #3572

Closed
alan-knight opened this issue Jun 12, 2012 · 12 comments
Closed

Highlighting and error checking in Dartdoc code #3572

alan-knight opened this issue Jun 12, 2012 · 12 comments
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@alan-knight
Copy link
Contributor

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.

@stevemessick
Copy link
Contributor

Added this to the Later milestone.
Added Type-Enhancement, Priority-Medium, Area-Editor labels.

@sethladd
Copy link
Contributor

Good point!


Removed this from the Later milestone.
Added this to the M6 milestone.

@bwilkerson
Copy link
Member

Removed Area-Editor label.
Added Area-Analyzer label.

@bwilkerson
Copy link
Member

Removed this from the M6 milestone.
Added this to the M7 milestone.

@jwren
Copy link
Member

jwren commented Sep 19, 2013

M7 -> M8


Removed this from the M7 milestone.
Added this to the M8 milestone.

@bwilkerson
Copy link
Member

Removed this from the M8 milestone.
Added this to the Later milestone.

@bwilkerson
Copy link
Member

Added Analyzer-Hint label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@alan-knight alan-knight added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@srawlins
Copy link
Member

srawlins commented Oct 9, 2015

This seems like it would be impossible to do without false positive warnings. The following code blocks, that might be found in Dartdoc comments, would produce false analyzer warnings:

  1. Dart code with pseudocode:

    callAFunction();
    callSomethingElse();
    ...
    var a = foo();
    
  2. Code blocks that don't contain Dart:

    <p>This is html. Not dart. The analyzer probably wouldn't take kindly to that.</p>
    
  3. Code with undeclared identifiers. Would the analyzer know that only a subset of warnings are valid in example code?

    someFunction(myVariable);
    

This would also pull in package:markdown as a dependency to the analyzer.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@srawlins
Copy link
Member

Close as infeasible for the reasons above?

@bwilkerson
Copy link
Member

There are ways to make things better than they are, but I don't care that much whether we leave this as a reminder or close it.

@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
copybara-service bot pushed a commit that referenced this issue Oct 18, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 28a2503..817e61d
 https://dart.googlesource.com/pub.git/+/817e61d9 Fix publishing (#3610)
 https://dart.googlesource.com/pub.git/+/97f638d0 PubToplevel.directory is never null. (#3587)
 https://dart.googlesource.com/pub.git/+/a3ee2099 Make binstubs offset invariant (#3586)
 https://dart.googlesource.com/pub.git/+/67e44b4b Make >=2.12 <3.0.0 compatible with dart 3 (#3572)
 https://dart.googlesource.com/pub.git/+/c287c110 Warn on `pub publish` if `dart analyze` has messages (#3568)
 https://dart.googlesource.com/pub.git/+/29d7d868 Cleaner pubspec.lock parsing (#3487)

```

Diff: https://dart.googlesource.com/pub.git/+/28a2503d7f4806e6854e3ed0d783f065abfd1b5f~..817e61d9eb174f77dfd2cb1d1de45826f66ac6bf/
Change-Id: I203963479a2bb78db80d8e645066a227febeef46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264680
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

9 participants