Skip to content

[LSP] Cache parsed xml snippets for razor#59605

Merged
dibarbet merged 5 commits intodotnet:mainfrom
dibarbet:snippet_cache
Feb 25, 2022
Merged

[LSP] Cache parsed xml snippets for razor#59605
dibarbet merged 5 commits intodotnet:mainfrom
dibarbet:snippet_cache

Conversation

@dibarbet
Copy link
Copy Markdown
Member

A followup change to the original PR. We can easily cache the SnippetParts we get from parsing the snippet XML so that we don't have to re-parse them from XML on each request.

@dibarbet dibarbet added the LSP issues related to the roslyn language server protocol implementation label Feb 17, 2022
@dibarbet dibarbet requested a review from a team as a code owner February 17, 2022 04:22
@ghost ghost added the Area-IDE label Feb 17, 2022
return parsedSnippet;
}

private static CodeSnippet RetrieveSnippetXmlFromFile(SnippetInfo snippetInfo)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private static ParsedXmlSnippet GetAndParseSnippetFromFile(SnippetInfo snippetInfo)
{
// Read the XML file to get the snippet and snippet metadata.
var matchingSnippet = RetrieveSnippetXmlFromFile(snippetInfo);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dibarbet dibarbet enabled auto-merge (squash) February 18, 2022 21:21
Copy link
Copy Markdown

@NTaylorMullen NTaylorMullen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dopeness and great comments! :shipit:

@dibarbet dibarbet merged commit fe206a3 into dotnet:main Feb 25, 2022
@ghost ghost added this to the Next milestone Feb 25, 2022
@dibarbet dibarbet deleted the snippet_cache branch February 25, 2022 20:15
333fred added a commit that referenced this pull request Feb 28, 2022
…ures/required-members

* upstream/main: (187 commits)
  Add GlobalOptions.SetBackgroundAnalysisScope and PythiaGlobalOptions External Access API (#59794)
  Update source-build dependency to source-build-externals (#59549)
  Do not retry on Clipboard API for StackTraceExplorer (#59658)
  Remove unnecessary accesses on XML end tag (#59771)
  Threading
  lint
  Improve PDB source document project handling (#59643)
  Disable Auto-Open behavior for Stack Trace Explorer (#59785)
  REmove comment
  Push async up
  Simplify
  Remove stale remarks
  Update src/Tools/ExternalAccess/FSharp/Navigation/FSharpDocumentNavigationService.cs
  Remove unnecessary code
  Simplify threading
  Update tests
  Make the  IDocumentNavigationSerivice entirely async.
  Disable additional text comparer in generator driver (#59776)
  [LSP] Cache parsed xml snippets for razor (#59605)
  Make static
  ...
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P2 Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE LSP issues related to the roslyn language server protocol implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants