Skip to content

Commit

Permalink
Merge pull request #473 from usethesource/more-consistent-service-names
Browse files Browse the repository at this point in the history
A consistent naming scheme for the LanguageService constructors , with backward compatibility functions.
  • Loading branch information
DavyLandman authored Oct 23, 2024
2 parents 9101cb0 + 4939d4b commit cd94730
Show file tree
Hide file tree
Showing 19 changed files with 814 additions and 553 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,49 +46,50 @@
public interface ILanguageContributions {
public String getName();

public CompletableFuture<ITree> parseSourceFile(ISourceLocation loc, String input);
public InterruptibleFuture<IList> outline(ITree input);
public InterruptibleFuture<IConstructor> analyze(ISourceLocation loc, ITree input);
public CompletableFuture<ITree> parsing(ISourceLocation loc, String input);
public InterruptibleFuture<IConstructor> analysis(ISourceLocation loc, ITree input);
public InterruptibleFuture<IConstructor> build(ISourceLocation loc, ITree input);
public InterruptibleFuture<IList> lenses(ITree input);
public InterruptibleFuture<@Nullable IValue> executeCommand(String command);
public CompletableFuture<IList> parseCodeActions(String command);
public InterruptibleFuture<IList> documentSymbol(ITree input);
public InterruptibleFuture<IList> codeLens(ITree input);
public InterruptibleFuture<IList> inlayHint(@Nullable ITree input);
public InterruptibleFuture<ISet> documentation(IList focus);
public InterruptibleFuture<ISet> definitions(IList focus);
public InterruptibleFuture<@Nullable IValue> execution(String command);
public InterruptibleFuture<ISet> hover(IList focus);
public InterruptibleFuture<ISet> definition(IList focus);
public InterruptibleFuture<ISet> references(IList focus);
public InterruptibleFuture<ISet> implementations(IList focus);
public InterruptibleFuture<IList> codeActions(IList focus);

public CompletableFuture<Boolean> hasAnalyzer();
public CompletableFuture<Boolean> hasBuilder();
public CompletableFuture<Boolean> hasOutliner();
public CompletableFuture<Boolean> hasLensDetector();
public CompletableFuture<Boolean> hasInlayHinter();
public CompletableFuture<Boolean> hasCommandExecutor();
public CompletableFuture<Boolean> hasDocumenter();
public CompletableFuture<Boolean> hasDefiner();
public CompletableFuture<Boolean> hasReferrer();
public CompletableFuture<Boolean> hasImplementer();
public CompletableFuture<Boolean> hasCodeActionsContributor();
public InterruptibleFuture<ISet> implementation(IList focus);
public InterruptibleFuture<IList> codeAction(IList focus);

public CompletableFuture<IList> parseCodeActions(String command);

public CompletableFuture<Boolean> hasAnalysis();
public CompletableFuture<Boolean> hasBuild();
public CompletableFuture<Boolean> hasDocumentSymbol();
public CompletableFuture<Boolean> hasCodeLens();
public CompletableFuture<Boolean> hasInlayHint();
public CompletableFuture<Boolean> hasExecution();
public CompletableFuture<Boolean> hasHover();
public CompletableFuture<Boolean> hasDefinition();
public CompletableFuture<Boolean> hasReferences();
public CompletableFuture<Boolean> hasImplementation();
public CompletableFuture<Boolean> hasCodeAction();

public CompletableFuture<SummaryConfig> getAnalyzerSummaryConfig();
public CompletableFuture<SummaryConfig> getBuilderSummaryConfig();
public CompletableFuture<SummaryConfig> getOndemandSummaryConfig();

public static class SummaryConfig {
public final boolean providesDocumentation;
public final boolean providesHovers;
public final boolean providesDefinitions;
public final boolean providesReferences;
public final boolean providesImplementations;

public SummaryConfig(
boolean providesDocumentation,
boolean providesHovers,
boolean providesDefinitions,
boolean providesReferences,
boolean providesImplementations) {

this.providesDocumentation = providesDocumentation;
this.providesHovers = providesHovers;
this.providesDefinitions = providesDefinitions;
this.providesReferences = providesReferences;
this.providesImplementations = providesImplementations;
Expand All @@ -98,14 +99,13 @@ public SummaryConfig(

public static SummaryConfig or(SummaryConfig a, SummaryConfig b) {
return new SummaryConfig(
a.providesDocumentation || b.providesDocumentation,
a.providesHovers || b.providesHovers,
a.providesDefinitions || b.providesDefinitions,
a.providesReferences || b.providesReferences,
a.providesImplementations || b.providesImplementations);
}
}


@FunctionalInterface // Type alias to conveniently pass methods `analyze`and `build` as parameters
public static interface ScheduledCalculator extends BiFunction<ISourceLocation, ITree, InterruptibleFuture<IConstructor>> {}

Expand Down
Loading

0 comments on commit cd94730

Please sign in to comment.