Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public void SetUp()
issueConsumerFactory = Substitute.For<IIssueConsumerFactory>();
issueConsumerStorage = Substitute.For<IIssueConsumerStorage>();
issueConsumer = Substitute.For<IIssueConsumer>();
logger = new TestLogger();
taggerProvider = CreateTaggerProvider();
mockTextSnapshot = CreateTextSnapshotMock();
mockDocumentTextBuffer = CreateTextBufferMock(mockTextSnapshot);
Expand Down
2 changes: 2 additions & 0 deletions src/Integration.Vsix/SonarLintTagger/TaggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public void AddIssueTracker(IIssueTracker issueTracker)
var filePath = issueTracker.LastAnalysisFilePath;
var content = issueTracker.GetText();

logger.LogVerbose(new MessageLevelContext(){VerboseContext = ["File Tracker Invoke"]}, "Open: {0}", filePath);
NotifyFileTracker(filePath, content);
// The lifetime of an issue tracker is tied to a single document. A document is opened, then a tracker is created.
DocumentOpened?.Invoke(this, new DocumentOpenedEventArgs(new Document(filePath, issueTracker.DetectedLanguages), content));
Expand All @@ -255,6 +256,7 @@ public void OnOpenDocumentRenamed(string newFilePath, string oldFilePath, IEnume

public void OnDocumentSaved(string fullPath, string newContent, IEnumerable<AnalysisLanguage> detectedLanguages)
{
logger.LogVerbose(new MessageLevelContext(){VerboseContext = ["File Tracker Invoke"]}, "Save: {0}", fullPath);
NotifyFileTracker(fullPath, newContent);
DocumentSaved?.Invoke(this, new DocumentSavedEventArgs(new Document(fullPath, detectedLanguages), newContent));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Integration/LocalServices/FileTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ private void NotifySlCoreFilesChanged(string[] removedFiles, SourceFile[] addedO
{
if (!serviceProvider.TryGetTransientService(out IFileRpcSLCoreService fileRpcSlCoreService))
{
logger.WriteLine(SLCoreStrings.ServiceProviderNotInitialized);
logger.LogVerbose(SLCoreStrings.ServiceProviderNotInitialized);
return;
}

if (activeConfigScopeTracker.Current is not { RootPath: not null } configScope)
{
logger.WriteLine(SLCoreStrings.ConfigScopeNotInitialized);
logger.LogVerbose(SLCoreStrings.ConfigScopeNotInitialized);
return;
}

Expand Down
Loading