API reference learned from exploring the NuGet package XML docs and IL disassembly for the JetBrains ReSharper/Rider SDK.
The JetBrains.ReSharper.SDK (v2025.3.2) is a meta-package. Actual assemblies live in separate NuGet packages:
| Package | Contains |
|---|---|
jetbrains.psi.features.core |
JetBrains.ReSharper.Feature.Services.dll - daemon, highlightings, refactorings |
jetbrains.psi.features.src |
JetBrains.ReSharper.Daemon.dll, JetBrains.ReSharper.Daemon.CSharp.dll |
jetbrains.platform.core.text |
JetBrains.Platform.TextControl.dll, JetBrains.Platform.Text.Protocol.dll - document markup, highlighters |
jetbrains.platform.core.shell |
JetBrains.Platform.Core.dll, JetBrains.Platform.Util.dll - core types, data structures |
SDK version 2025.3.2 maps to internal build version 253.0.20260129.45253.
The main daemon interface. Does NOT have a GetHighlightings() method.
ForceReHighlight(IDocument)- force re-highlight a documentInvalidate()- invalidate all daemon dataInvalidate(string)- invalidate by keyInvalidate(IDocument)- invalidate for a documentInvalidate(string, IDocument)- invalidate by key + documentStateWithDescription(IDocument)- get daemon state for a document
DaemonStateChanged- event signal for daemon state changes
Used internally in DaemonStageResult to pass highlighting results from daemon stages. Members are NOT well-documented in the public XML docs - treat as internal.
DaemonStageResult(IReadOnlyList<HighlightingInfo>)DaemonStageResult(IReadOnlyList<HighlightingInfo>, byte)DaemonStageResult(IReadOnlyList<HighlightingInfo>, DocumentRange)
Interface for semantic highlighting data.
IsValid()- check if the highlighting is still validToolTip- tooltip textErrorStripeToolTip- error stripe tooltip text
enum Severity { INFO, HINT, SUGGESTION, WARNING, ERROR }enum SolutionAnalysisMode {
LocalInspection,
GlobalInspection,
LocalAndGlobalInspection,
LocalInspectionExcludedFromSolutionAnalysisResults
}Type exists but has NO documented public methods in XML docs. Likely internal or inherited.
PausedByUser- whether user paused SWEAPaused- whether SWEA is pausedCompletedOnceAfterStart- whether analysis completed at least once
Pause(Lifetime, string)- pause analysis with a reason
This is the primary public API for reading daemon/inspection results from a plugin.
Shell-level component. Get via Shell.Instance.GetComponent<IDocumentMarkupManager>().
GetMarkupModel(IDocument)- get markup model for a documentTryGetMarkupModel(IDocument)- get markup model or nullGetMarkupModelAndKeepAlive(Lifetime, IDocument)- get markup and keep aliveAdviseMarkupEvents(Lifetime, IDocument, IDocumentMarkupEvents)- subscribe to markup changes
Per-document markup model containing all highlighters.
Document- the document this markup belongs to
GetHighlightersEnumerable(OnWriteLockRequestedBehavior, Func<IHighlighter, bool>)- enumerate highlighters with optional filterGetHighlightersEnumerable(string key, OnWriteLockRequestedBehavior, Func<IHighlighter, bool>)- enumerate with key filterGetHighlightersOver(TextRange, OnWriteLockRequestedBehavior, Func<IHighlighter, bool>)- highlighters in a rangeAddHighlighterCustom(...)- add a custom highlighterAddHighlighterRegistered(...)- add a registered highlighterRemoveHighlighter(IHighlighter)/RemoveHighlighterAsync(IHighlighter)RemoveHighlighters(string key)/RemoveHighlightersAsync(string key)RemoveAllHighlighters()BatchChangeCookie(string)- batch changes
GetFilteredHighlighters(IDocumentMarkup, Func<IHighlighter, bool>)GetFilteredHighlightersOver(IDocumentMarkup, TextRange, Func<IHighlighter, bool>)
Individual highlighter on a document. Implementations (e.g. HighlighterOnRangeMarker) also implement IRangeable.
Attributes-HighlighterAttributesAttributeId- string identifier for the highlighting kindErrorStripeAttributes- nullableErrorStripeAttributes(severity info)GutterMarkType- gutter mark infoAdornmentDataModel- adornment dataKey- string key identifying the highlighter groupLayer-HighlighterLayerUserData-UserDataWrapperfor custom data
TryGetTooltip(HighlighterTooltipKind)- get tooltip (returns object with.ToString())
Interface for range information. IHighlighter implementations also implement this.
Document- the documentIsValid- whether the range is still validRange-TextRange(start/end offsets)
Usage: Cast IHighlighter to IRangeable to get range:
if (highlighter is JetBrains.TextControl.Data.IRangeable rangeable && rangeable.Range.IsValid)
{
int startOffset = rangeable.Range.StartOffset;
}Attached to highlighters that appear on the error stripe.
MarkerKind-ErrorStripeMarkerKindenumErrorStripeColorHighlighterAttributeId- attribute ID for color
enum ErrorStripeMarkerKind { Info, Suggestion, Warning, Error, Usage }Severity mapping:
| MarkerKind | Display |
|---|---|
| Error | [ERROR] |
| Warning | [WARNING] |
| Suggestion | [SUGGESTION] |
| Info | [HINT] |
| Usage | (skip - find usages highlight) |
ErrorStripe- tooltip for error stripe marker
IMPORTANT: Note the lowercase d in dataStructures - this is the actual namespace casing.
Found via IL disassembly of JetBrains.Platform.Core.dll:
// JetBrains.Util.dataStructures.OnWriteLockRequestedBehavior
enum OnWriteLockRequestedBehavior
{
THROW_OCE = 0, // Throw OperationCanceledException
MATERIALIZE_ENUMERABLE = 1, // Materialize the enumerable into a list first
IGNORE_WRITE_LOCK_AND_CONTINUE_ENUMERATION = 2 // Ignore write lock, continue enumerating
}Usage:
markup.GetHighlightersEnumerable(
JetBrains.Util.dataStructures.OnWriteLockRequestedBehavior.MATERIALIZE_ENUMERABLE,
null);Use DocumentOffset instead of raw offset integers. IDocument.GetCoordsByOffset(int) is obsolete.
// Correct (modern API):
var docOffset = new DocumentOffset(document, offset);
var coords = docOffset.ToDocumentCoords();
int line = (int)coords.Line + 1; // Line is 0-based
// Obsolete (avoid):
// document.GetCoordsByOffset(offset)All RD model interactions (Advise, Fire, property read/write) must execute on the protocol's scheduler thread ("Shell Rd Dispatcher"). Components marked ContainerAsyncAnyThreadSafe are constructed on pool threads and will throw LoggerException ("Illegal scheduler") if they touch the model directly.
| Type | Namespace | Notes |
|---|---|---|
IScheduler |
JetBrains.Collections.Viewable |
Protocol thread scheduler |
RdExtBase |
JetBrains.Rd.Base |
Base class for generated models. Proto property is protected |
TryGetProto() |
JetBrains.Rd.Base (extension) |
Public way to access IProtocol from any IRdBindable |
IProtocol.Scheduler |
JetBrains.Rd |
The IScheduler for queuing RD-thread work |
using JetBrains.Collections.Viewable; // IScheduler
using JetBrains.Rd.Base; // TryGetProto() extension
var protocolSolution = solution.GetProtocolSolution();
IScheduler scheduler = protocolSolution.TryGetProto()?.Scheduler;
// All RD operations go through Queue():
scheduler?.Queue(() =>
{
var model = protocolSolution.GetFathomModel();
model.Port.Advise(lifetime, newPort => { /* ... */ });
model.ServerStatus.Fire(new ServerStatus(true, port, "ok"));
});Enqueues the action to run on the protocol dispatcher thread. Safe to call from any thread. If the scheduler is already on the correct thread, the action runs synchronously.
#pragma warning disable CS0612 // ActionAttribute(string, string) is obsolete in 2025.3
[Action("UniqueActionId", "Display Text",
Id = 1234, // unique numeric ID
IdeaShortcuts = new[] { "Control+Alt+Shift+X" })]
#pragma warning restore CS0612
public class MyAction : IExecutableAction
{
public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
{
// Return true if action is available
return context.GetData(ProjectModelDataConstants.SOLUTION) != null;
}
public void Execute(IDataContext context, DelegateExecute nextExecute)
{
var solution = context.GetData(ProjectModelDataConstants.SOLUTION);
// ... action logic
MessageBox.ShowInfo("Done!");
}
}Key types:
IDataContext(JetBrains.Application.DataContext)ActionPresentation/DelegateUpdate/DelegateExecute(JetBrains.Application.UI.Actions)ProjectModelDataConstants.SOLUTION(JetBrains.ProjectModel.DataContext) - get ISolution from contextShell.Instance.GetComponent<T>()(JetBrains.ReSharper.Resources.Shell) - resolve shell componentssolution.GetComponent<T>()- resolve solution componentsMessageBox.ShowInfo(string)(JetBrains.Util) - show info dialog
[ShellComponent]
public class MyComponent
{
public MyComponent(Lifetime lifetime, IActionManager actionManager)
{
// Runs on shell initialization
}
}[SolutionComponent]
public class MySolutionComponent
{
public MySolutionComponent(ISolution solution)
{
// Runs when solution opens
}
}foreach (var project in solution.GetAllProjects())
{
foreach (var projectFile in project.GetAllProjectFiles())
{
IPsiSourceFile sourceFile = projectFile.ToSourceFile();
if (sourceFile == null) continue;
IDocument document = sourceFile.Document;
FileSystemPath location = sourceFile.GetLocation();
FileSystemPath relative = location.MakeRelativeTo(solution.SolutionDirectory);
}
}[ZoneDefinition]
public interface IMyPluginZone : IZone, IRequire<ICodeEditingZone> { }Zones control feature availability. ICodeEditingZone (JetBrains.ReSharper.Feature.Services) is required for code editing features.
| Namespace | Contains |
|---|---|
JetBrains.ReSharper.Feature.Services.Daemon |
IDaemon, IHighlighting, Severity, HighlightingInfo, DaemonStageResult |
JetBrains.ReSharper.Daemon |
SolutionAnalysisService, SolutionAnalysisConfiguration, DaemonImpl |
JetBrains.TextControl.DocumentMarkup |
IDocumentMarkupManager, IDocumentMarkup, IHighlighter, ErrorStripeMarkerKind |
JetBrains.TextControl.Data |
IRangeable |
JetBrains.Util.dataStructures |
OnWriteLockRequestedBehavior (lowercase d) |
JetBrains.DocumentModel |
IDocument, DocumentRange, DocumentOffset |
JetBrains.ProjectModel |
ISolution, IProject, IProjectFile |
JetBrains.ProjectModel.DataContext |
ProjectModelDataConstants |
JetBrains.ReSharper.Psi |
IPsiSourceFile, IPsiModules |
JetBrains.Application.UI.Actions |
IExecutableAction, ActionPresentation |
JetBrains.Application.UI.ActionsRevised.Menu |
Action attribute |
JetBrains.ReSharper.Resources.Shell |
Shell |
JetBrains.Lifetimes |
Lifetime |
JetBrains.Application.BuildScript.Application.Zones |
ZoneDefinition, IZone, IRequire |
Packages for this SDK live at C:\Users\<user>\.nuget\packages\:
- XML docs are in
<package>\<version>\DotFiles\<Assembly>.xml - DLLs are in
<package>\<version>\DotFiles\<Assembly>.dll - Use
ildasmfor types not documented in XML (enum values, internal members)