ace-linters 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -597,6 +597,17 @@ export interface ProviderOptions {
597
597
  "CompletionProvider"?: typeof CompletionProvider;
598
598
  };
599
599
  }
600
+ export interface SessionInitialConfig {
601
+ /**
602
+ * The associated file path for the session
603
+ */
604
+ filePath: string;
605
+ /**
606
+ * Determines if the editor should join the workspace URI
607
+ * @default `false`
608
+ */
609
+ joinWorkspaceURI?: boolean;
610
+ }
600
611
  export type ServiceFeatures = {
601
612
  [feature in SupportedFeatures]?: boolean;
602
613
  };
@@ -720,6 +731,66 @@ declare class MarkerGroup {
720
731
  setMarkers(markers: any): void;
721
732
  update(html: any, markerLayer: any, session: any, config: any): void;
722
733
  }
734
+ declare class SessionLanguageProvider {
735
+ session: Ace.EditSession;
736
+ documentUri: string;
737
+ private $messageController;
738
+ private $deltaQueue;
739
+ private $isConnected;
740
+ private $options?;
741
+ private $filePath;
742
+ private $servicesCapabilities?;
743
+ private $requestsQueue;
744
+ state: {
745
+ occurrenceMarkers: MarkerGroup | null;
746
+ diagnosticMarkers: MarkerGroup | null;
747
+ };
748
+ private extensions;
749
+ editor: Ace.Editor;
750
+ private semanticTokensLegend?;
751
+ private $provider;
752
+ /**
753
+ * Constructs a new instance of the `SessionLanguageProvider` class.
754
+ *
755
+ * @param provider - The `LanguageProvider` instance.
756
+ * @param session - The Ace editor session.
757
+ * @param editor - The Ace editor instance.
758
+ * @param messageController - The `IMessageController` instance for handling messages.
759
+ * @param config
760
+ */
761
+ constructor(provider: LanguageProvider, session: Ace.EditSession, editor: Ace.Editor, messageController: IMessageController, config?: SessionInitialConfig);
762
+ enqueueIfNotConnected(callback: () => void): void;
763
+ get comboDocumentIdentifier(): ComboDocumentIdentifier;
764
+ /**
765
+ * Sets the file path for the current document and optionally joins it with the workspace URI.
766
+ * Increments the document version and updates the internal document URI and identifier.
767
+ *
768
+ * @param {string} filePath - The new file path for the document.
769
+ * @param {boolean} [joinWorkspaceURI] - Optional flag to indicate whether to join the file path with the workspace URI.
770
+ */
771
+ setFilePath(filePath: string, joinWorkspaceURI?: boolean): void;
772
+ private $init;
773
+ addSemanticTokenSupport(session: Ace.EditSession): void;
774
+ private $connected;
775
+ private $changeMode;
776
+ setServerCapabilities: (capabilities: {
777
+ [serviceName: string]: lsp.ServerCapabilities;
778
+ }) => void;
779
+ private initDocumentUri;
780
+ private get $extension();
781
+ private get $mode();
782
+ private get $format();
783
+ private $changeListener;
784
+ $sendDeltaQueue: (callback?: any) => any;
785
+ $showAnnotations: (diagnostics: lsp.Diagnostic[]) => void;
786
+ setOptions<OptionsType extends ServiceOptions>(options: OptionsType): void;
787
+ validate: () => void;
788
+ format: () => void;
789
+ applyEdits: (edits: lsp.TextEdit[]) => void;
790
+ getSemanticTokens(): void;
791
+ $applyDocumentHighlight: (documentHighlights: lsp.DocumentHighlight[]) => void;
792
+ closeDocument(callback?: any): void;
793
+ }
723
794
  declare class LanguageProvider {
724
795
  activeEditor: Ace.Editor;
725
796
  private readonly $messageController;
@@ -741,7 +812,7 @@ declare class LanguageProvider {
741
812
  private completerAdapter?;
742
813
  private constructor();
743
814
  /**
744
- * Creates LanguageProvider using our transport protocol with ability to register different services on same
815
+ * Creates LanguageProvider using our transport protocol with the ability to register different services on the same
745
816
  * webworker
746
817
  * @param {Worker} worker
747
818
  * @param {ProviderOptions} options
@@ -768,19 +839,29 @@ declare class LanguageProvider {
768
839
  setProviderOptions(options?: ProviderOptions): void;
769
840
  private checkInlineCompletionAdapter;
770
841
  /**
771
- * @param session
772
- * @param filePath - The full file path associated with the editor.
842
+ * Sets the file path for the given Ace edit session. Optionally allows the file path to
843
+ * be joined with the workspace URI.
844
+ *
845
+ * @param session The Ace edit session to update with the file path.
846
+ * @param config config to set
773
847
  */
774
- setSessionFilePath(session: Ace.EditSession, filePath: string): void;
848
+ setSessionFilePath(session: Ace.EditSession, config: SessionInitialConfig): void;
775
849
  private $registerSession;
776
850
  private $getSessionLanguageProvider;
777
851
  private $getFileName;
778
852
  /**
779
- * Registers an Ace editor instance with the language provider.
780
- * @param editor - The Ace editor instance to register.
853
+ * Registers an Ace editor instance along with the session's configuration settings.
854
+ *
855
+ * @param editor - The Ace editor instance to be registered.
856
+ * @param [config] - Configuration options for the session.
781
857
  */
782
- registerEditor(editor: Ace.Editor): void;
858
+ registerEditor(editor: Ace.Editor, config?: SessionInitialConfig): void;
783
859
  codeActionCallback: (codeActions: CodeActionsByService[]) => void;
860
+ /**
861
+ * Sets a callback function that will be triggered with an array of code actions grouped by service.
862
+ *
863
+ * @param {function} callback - A function that receives an array of code actions, categorized by service, as its argument.
864
+ */
784
865
  setCodeActionCallback(callback: (codeActions: CodeActionsByService[]) => void): void;
785
866
  executeCommand(command: string, serviceName: string, args?: any[], callback?: (something: any) => void): void;
786
867
  applyEdit(workspaceEdit: lsp.WorkspaceEdit, serviceName: string, callback?: (result: lsp.ApplyWorkspaceEditResult, serviceName: string) => void): void;
@@ -790,6 +871,13 @@ declare class LanguageProvider {
790
871
  private createHoverNode;
791
872
  private createErrorNode;
792
873
  private setStyles;
874
+ /**
875
+ * Sets global options for the specified service.
876
+ *
877
+ * @param serviceName - The name of the service for which to set global options.
878
+ * @param options - The options to set for the specified service.
879
+ * @param {boolean} [merge=false] - Indicates whether to merge the provided options with the existing options. Defaults to false.
880
+ */
793
881
  setGlobalOptions<T extends keyof ServiceOptionsMap>(serviceName: T & string, options: ServiceOptionsMap[T], merge?: boolean): void;
794
882
  /**
795
883
  * Sets the workspace URI for the language provider.
@@ -802,7 +890,20 @@ declare class LanguageProvider {
802
890
  * @param workspaceUri - The new workspace URI. Could be simple path, not URI itself.
803
891
  */
804
892
  changeWorkspaceFolder(workspaceUri: string): void;
893
+ /**
894
+ * Sets the options for a specified editor session.
895
+ *
896
+ * @param session - The Ace editor session to configure.
897
+ * @param options - The configuration options to be applied to the session.
898
+ */
805
899
  setSessionOptions<OptionsType extends ServiceOptions>(session: Ace.EditSession, options: OptionsType): void;
900
+ /**
901
+ * Configures the specified features for a given service.
902
+ *
903
+ * @param {SupportedServices} serviceName - The name of the service for which features are being configured.
904
+ * @param {ServiceFeatures} features - The features to be configured for the given service.
905
+ * @return {void} Does not return a value.
906
+ */
806
907
  configureServiceFeatures(serviceName: SupportedServices, features: ServiceFeatures): void;
807
908
  doHover(session: Ace.EditSession, position: Ace.Point, callback?: (hover: Tooltip | undefined) => void): void;
808
909
  provideSignatureHelp(session: Ace.EditSession, position: Ace.Point, callback?: (signatureHelp: Tooltip | undefined) => void): void;
@@ -830,61 +931,6 @@ declare class LanguageProvider {
830
931
  sendRequest(serviceName: string, method: string, params: any, callback?: (result: any) => void): void;
831
932
  showDocument(params: lsp.ShowDocumentParams, serviceName: string, callback?: (result: lsp.LSPAny, serviceName: string) => void): void;
832
933
  }
833
- declare class SessionLanguageProvider {
834
- session: Ace.EditSession;
835
- documentUri: string;
836
- private $messageController;
837
- private $deltaQueue;
838
- private $isConnected;
839
- private $options?;
840
- private $filePath;
841
- private $servicesCapabilities?;
842
- private $requestsQueue;
843
- state: {
844
- occurrenceMarkers: MarkerGroup | null;
845
- diagnosticMarkers: MarkerGroup | null;
846
- };
847
- private extensions;
848
- editor: Ace.Editor;
849
- private semanticTokensLegend?;
850
- private $provider;
851
- /**
852
- * Constructs a new instance of the `SessionLanguageProvider` class.
853
- *
854
- * @param provider - The `LanguageProvider` instance.
855
- * @param session - The Ace editor session.
856
- * @param editor - The Ace editor instance.
857
- * @param messageController - The `IMessageController` instance for handling messages.
858
- */
859
- constructor(provider: LanguageProvider, session: Ace.EditSession, editor: Ace.Editor, messageController: IMessageController);
860
- enqueueIfNotConnected(callback: () => void): void;
861
- get comboDocumentIdentifier(): ComboDocumentIdentifier;
862
- /**
863
- * @param filePath
864
- */
865
- setFilePath(filePath: string): void;
866
- private $init;
867
- addSemanticTokenSupport(session: Ace.EditSession): void;
868
- private $connected;
869
- private $changeMode;
870
- setServerCapabilities: (capabilities: {
871
- [serviceName: string]: lsp.ServerCapabilities;
872
- }) => void;
873
- private initDocumentUri;
874
- private get $extension();
875
- private get $mode();
876
- private get $format();
877
- private $changeListener;
878
- $sendDeltaQueue: (callback?: any) => any;
879
- $showAnnotations: (diagnostics: lsp.Diagnostic[]) => void;
880
- setOptions<OptionsType extends ServiceOptions>(options: OptionsType): void;
881
- validate: () => void;
882
- format: () => void;
883
- applyEdits: (edits: lsp.TextEdit[]) => void;
884
- getSemanticTokens(): void;
885
- $applyDocumentHighlight: (documentHighlights: lsp.DocumentHighlight[]) => void;
886
- closeDocument(callback?: any): void;
887
- }
888
934
  export declare class AceLanguageClient {
889
935
  /**
890
936
  * Creates LanguageProvider for any Language Server to connect with JSON-RPC (webworker, websocket)