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

Roslyn Tokenizer #11086

Merged
merged 44 commits into from
Oct 25, 2024
Merged

Roslyn Tokenizer #11086

merged 44 commits into from
Oct 25, 2024

Commits on Jul 26, 2024

  1. Configuration menu
    Copy the full SHA
    46698be View commit details
    Browse the repository at this point in the history
  2. Duplicate existing tokenizer and add a flag to control whether to use…

    … the roslyn or legacy tokenizers.
    333fred committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    b3f0a12 View commit details
    Browse the repository at this point in the history
  3. Remove roslyn package pinning

    333fred committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    14f71e2 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Legacy->Native

    333fred committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b3f055a View commit details
    Browse the repository at this point in the history
  2. Roslyn Tokenizer Infrastructure (#10676)

    This is some of the infrastructure that will be needed to get the Roslyn
    tokenizer in. We'll have the new tokenizer, and an option to switch back
    to the legacy tokenizer. To make reviewing easier, I would highly
    suggest going commit-by-commit, to make sure that the renames show up as
    actual renames.
    333fred authored Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b9c924b View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'upstream/main' into merge-main

    * upstream/main:
      Disable nullable warnings on .NET Standard and Framework (#10677)
    333fred committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    4346076 View commit details
    Browse the repository at this point in the history
  4. Merge main (#10679)

    Merge main into the feature branch
    333fred authored Jul 29, 2024
    Configuration menu
    Copy the full SHA
    a35513a View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Configuration menu
    Copy the full SHA
    894a9ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a15d7cc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3a8fd07 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    60ac8d1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    73aa717 View commit details
    Browse the repository at this point in the history
  6. Add consolidated syntax kinds. Since there aren't consumers that care…

    … about the individual differences between most C# operators, as well the difference between C# numeric types, we'll just use a single kind in the new parser to keep things simpler.
    333fred committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    dcef8ed View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5749a8e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2823f64 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c25ac20 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    34ab111 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    abd6aba View commit details
    Browse the repository at this point in the history
  12. Name change

    333fred committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    acf7a60 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Configuration menu
    Copy the full SHA
    640d377 View commit details
    Browse the repository at this point in the history
  2. PR feedback.

    333fred committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    3155200 View commit details
    Browse the repository at this point in the history
  3. Convert to the correct type

    333fred committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    1a0d57d View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. Additional commenting and PR feedback. I've simplified the reset loop…

    … to just be from the back of the results, as that's the most common order for the parser to reset in. I've also refactored a common advance loop to reduce duplication.
    333fred committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    aa24f69 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. More feedback

    333fred committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    5b7e927 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Use the roslyn tokenizer (#10702)

    This is the big one: using the Roslyn tokenizer during Razor parsing.
    I've done my best to separate out various pieces into separate commits
    to make the review a bit simpler, but there's no getting around the
    lexer change being complicated. I would recommend commit-by-commit to
    make it as simple as possible. Fixes
    #10568, fixes
    #7084.
    333fred authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    91bbfde View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/main' into features/roslyn-tok…

    …enizer
    
    * upstream/main: (53 commits)
      Move to central package pinning (#10716)
      Try to fix rename tests
      Unskip rename tests
      I spent 10 minutes looking up cool Mr Freeze catch phrases for this commit message, and I didn't like any of them.
      Clean up CompilationTagHelperResolver
      Clean up all ITagHelperDescriptorProviders a bit (and found a bug!)
      Make ExcludeHidden and IncludeDocumentation init-only properties
      Swap TagHelperDescriptorProviderContext.Create methods for constructors
      Remove TagHelperDescriptorProviderContext.Items property
      Make TargetSymbol a TagHelperDescriptorProviderContext property
      Make Compilation a TagHelperDescriptorProviderContext property
      Merge TagHelperDescriptorProviderContext and DefaultContext
      Don't pass code document and source text around in diagnostics translator, plus some cleanup
      Remove unnecessary parameter, because it can be trivially retrieved
      Find razor document correctly in RemoveDocumentMappingService
      Add extension methods that convert URIs to Roslyn file paths
      Use Uri.LocalPath rather than GetAbsoluteOrUNCPath()
      Move MapToHostDocuementUriAndRangeAsync to extension methods
      Fix small typo in comment
      Remove unused DocumentState method
      ...
    333fred committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    711bda8 View commit details
    Browse the repository at this point in the history
  3. Merge main to tokenizer branch (#10724)

    Clean merge, no manual changes required
    333fred authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    8bf616a View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. Plumb CSharpParseOptions to the tokenizer (#10733)

    Does as the tin says. Prerequisite to handling directives, as we'll need the parse options to know what preprocessor symbols are enabled.
    333fred authored Aug 13, 2024
    Configuration menu
    Copy the full SHA
    fef2d1c View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

  1. Merge remote-tracking branch 'upstream/main' into merge-main

    * upstream/main: (71 commits)
      Fix after merge
      PR feedback
      Bump Roslyn version
      Moving formatting service to common layer (#10761)
      Move GetSyntaxTree to document snapshot
      Inject file path service into the document snapshot
      Remove code document parameter and just use document snapshot
      Update NOTICE.txt (#10768)
      Allow @@ as a fallback (#10752)
      Rework how we get generated documents
      Directly test the component definition service in cohosting
      Add missing test case
      Defer to C# for component attribute GTD in cohosting
      Allow LSP and cohosting to provide specialized methods to get a syntax tree for a C# document
      Dev Container (#10751)
      Use a proper Try pattern
      Add tests for co-hosted GTD
      Rework IDocumentPositionInfoStrategy and use correctly in co-hosted GTD
      Add DocumentMappingSerice to RazorDocumentServiceBase
      Move IDocumentPositionInfoStrategy and friends to Workspaces layer
      ...
    333fred committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    35871e3 View commit details
    Browse the repository at this point in the history
  2. Merge main to tokenizer branch (#10781)

    Minor touchup of usings and baselines necessary, no functional changes.
    333fred authored Aug 22, 2024
    Configuration menu
    Copy the full SHA
    647126b View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. Merge remote-tracking branch 'upstream/main' into features/roslyn-tok…

    …enizer
    
    * upstream/main: (270 commits)
      Fix after merge
      PR Feedback
      Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240905.1
      Fix auto insert service after merge from main
      PR Feedback
      Use ImmutableArray in SourceTextDiffer too
      Create a helper method and revert change to shared code, just in case
      Convert HtmlFormatter to ImmutableArray<TextChange>
      IEnumarable to ImmutableArray
      Remove some more usage of LSP types, and simplify ranges to line numbers
      Use pooled collections in a few more spots
      Extract common code to helper method
      Rename some methods to Try... pattern
      Rename some variables etc.
      Fix broken tests
      Get all consuming code compiling again
      Convert TextEdit to TextChange
      Remove flaky test
      OnAutoInsert Cohosting Tests (#10829)
      Update GetLanguageKind(...) tests and move to Workspaces.Test
      ...
    333fred committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    d7d4932 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0ea44ba View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Merge main to tokenizer branch (#10872)

    Will call out the merge locations.
    333fred authored Sep 12, 2024
    Configuration menu
    Copy the full SHA
    87dafaf View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. Support directive tokenization (#10979)

    * Add new preprocessor tests for the old parser, and copy their baselines over to the new parser for comparison.
    
    * Add line whitespace tracking for erroring when a preprocessor token isn't the first thing on a line.
    
    * Add initial support for parsing directives in the new lexer.
    
    * Initial work on plumbing through parser changes to correctly support directives. Many more tests are required.
    
    * Add more tests for other control flow blocks
    
    * Several misc refactors
    
    * Error on def and undef
    
    * Start testing beginning-of-line enforcement.
    
    * Report a warning when we see potential misplaced directives in disabled text.
    
    * Add more tests, include the correct location in warnings.
    
    * Usings, recomment GenerateBaselines
    
    * Nullable annotations
    
    * Update baselines, skip design time verification where tracked by #10981.
    
    * Feedback.
    
    * More feedback.
    333fred authored Oct 11, 2024
    Configuration menu
    Copy the full SHA
    07b168a View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2024

  1. Enable the new tokenizer for tooling tests (#11010)

    * Enable the new tokenizer for tooling tests
    
    * Use the new lexer in the integration tests as well.
    
    * Move to new lexer in a lot more places
    333fred authored Oct 15, 2024
    Configuration menu
    Copy the full SHA
    99c61dd View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2024

  1. Configuration menu
    Copy the full SHA
    2f584c9 View commit details
    Browse the repository at this point in the history
  2. Reset isOnlyWhitespaceOnLine in scenario revealed in IDE test

    Also ensure that another IDE test is run with the new lexer.
    333fred committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    7598fbf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dfe65f9 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2024

  1. Merge remote-tracking branch 'upstream/main' into merge-main

    * upstream/main: (290 commits)
      Add breaking changes document (#11064)
      Do not extract component into code block (#11069)
      Fix invalid setttings json (#11062)
      update MicrosoftSourceBuildIntermediatearcadePackageVersion
      Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566512
      Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566512
      Update source-build team references (#11032)
      Handle EditorRequired *Changed/*Expression parameters (#11043)
      Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566213
      Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2566213
      Avoid ambiguous `object` reference in generic component recovery (#11053)
      Move culture info check (#11057)
      Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20241015.1
      Fix code actions integration tests
      Add option for format on paste (#11039)
      Update src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDocumentClassifierPass.cs
      Fix merge to 17.12 version
      Update src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentDocumentClassifierPass.cs
      Ensure model directives are mapped at runtime (#11007)
      Fix @inherits mapping for fuse (#10985)
      ...
    333fred committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    2aac41c View commit details
    Browse the repository at this point in the history
  2. One more baseline update

    333fred committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    7b81af5 View commit details
    Browse the repository at this point in the history
  3. Merge main (#11075)

    Merge main into the feature branch. Only trivial merge conflicts and
    baseline updates were needed.
    333fred authored Oct 23, 2024
    Configuration menu
    Copy the full SHA
    c724539 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2024

  1. Final lexer changes (#11078)

    * Switch the new lexer off-by-default.
    
    * Add a new document for the lexer breaking changes around pragmas.
    
    * Update comment.
    
    * Feedback
    
    Co-authored-by: Jan Jones <[email protected]>
    
    ---------
    
    Co-authored-by: Jan Jones <[email protected]>
    333fred and jjonescz authored Oct 24, 2024
    Configuration menu
    Copy the full SHA
    c20c1cd View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/main' into merge-main

    * upstream/main:
      Fix resource string (#11079)
      Update Roslyn.Diagnostics.Analyzers package to latest version
      Update MS.CA.Analyzers package to 3.11.0
      Don't reference MS.CA.BannedApiAnalyzers package directly
      Version Roslyn.Diagnostics.Analzyers package separately
      Update dependencies from https://github.com/dotnet/arcade build 20241016.1
      Update dependencies from https://github.com/dotnet/arcade build 20241016.1
      Update dependencies from https://github.com/dotnet/arcade build 20241016.1
    333fred committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    6169824 View commit details
    Browse the repository at this point in the history
  3. Merge main to tokenizer branch (#11085)

    Trivial conflict resolutions only.
    333fred authored Oct 24, 2024
    Configuration menu
    Copy the full SHA
    927d6a9 View commit details
    Browse the repository at this point in the history