Socket
Socket
Sign inDemoInstall

atom-ide-base

Package Overview
Dependencies
5
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

22

CHANGELOG.md

@@ -1,2 +0,2 @@

# [1.1.0](https://github.com/atom-ide-community/atom-ide-base/compare/v1.0.0...v1.1.0) (2020-07-21)
## [1.1.1](https://github.com/atom-ide-community/atom-ide-base/compare/v1.1.0...v1.1.1) (2020-07-21)

@@ -6,18 +6,22 @@

* add description to package.json ([e94505a](https://github.com/atom-ide-community/atom-ide-base/commit/e94505a63658299103c931b3f83baa64c7a13cd6))
* add readme about the types ([18eb027](https://github.com/atom-ide-community/atom-ide-base/commit/18eb027b6eba2e0ceffba3f0ca27a259ac35f088))
* add types scripts ([b99f92b](https://github.com/atom-ide-community/atom-ide-base/commit/b99f92bb0f01557989bde9ccf07b52341c034f85))
* rename index.d.ts ([7d2e5ed](https://github.com/atom-ide-community/atom-ide-base/commit/7d2e5ed91b894dee3934f8eb6ba7bd64be17a662))
* use normal typescript syntax ([fe40ec2](https://github.com/atom-ide-community/atom-ide-base/commit/fe40ec2d6c0a193899bb5d5308ab45ceb8498295))
* format ([250e850](https://github.com/atom-ide-community/atom-ide-base/commit/250e85025e7ed05f67b0508fd5b8cf295124240e))
# [1.1.0](https://github.com/atom-ide-community/atom-ide-base/compare/v1.0.0...v1.1.0) (2020-07-21)
### Bug Fixes
- add description to package.json ([e94505a](https://github.com/atom-ide-community/atom-ide-base/commit/e94505a63658299103c931b3f83baa64c7a13cd6))
- add readme about the types ([18eb027](https://github.com/atom-ide-community/atom-ide-base/commit/18eb027b6eba2e0ceffba3f0ca27a259ac35f088))
- add types scripts ([b99f92b](https://github.com/atom-ide-community/atom-ide-base/commit/b99f92bb0f01557989bde9ccf07b52341c034f85))
- rename index.d.ts ([7d2e5ed](https://github.com/atom-ide-community/atom-ide-base/commit/7d2e5ed91b894dee3934f8eb6ba7bd64be17a662))
- use normal typescript syntax ([fe40ec2](https://github.com/atom-ide-community/atom-ide-base/commit/fe40ec2d6c0a193899bb5d5308ab45ceb8498295))
### Features
* add npm release to allow using types ([806b9a5](https://github.com/atom-ide-community/atom-ide-base/commit/806b9a51f6aa39dfb417afc5c34bcfb3c1dfb912))
- add npm release to allow using types ([806b9a5](https://github.com/atom-ide-community/atom-ide-base/commit/806b9a51f6aa39dfb417afc5c34bcfb3c1dfb912))
# 1.0.0 (2020-07-21)
### Bug Fixes
* deps installation ([7b7baa1](https://github.com/atom-ide-community/atom-ide-base/commit/7b7baa1032a70b5e67da75dc820fe27c637ec92a))
- deps installation ([7b7baa1](https://github.com/atom-ide-community/atom-ide-base/commit/7b7baa1032a70b5e67da75dc820fe27c637ec92a))

@@ -1,45 +0,43 @@

// declare module "atom-ide-base" {
export interface BusySignalOptions {
// Can say that a busy signal will only appear when a given file is open.
// Default = `null`, meaning the busy signal applies to all files.
onlyForFile?: string;
// Is user waiting for computer to finish a task? (traditional busy spinner)
// or is the computer waiting for user to finish a task? (action required)
// Default = spinner.
waitingFor?: "computer" | "user";
// Debounce it? default = `true` for busy-signal, and false for action-required.
debounce?: boolean;
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
onDidClick?: () => void;
// If set to `true`, the busy signal tooltip will be immediately revealed
// when it first becomes visible (without explicit mouse interaction).
revealTooltip?: boolean;
}
export interface BusySignalOptions {
// Can say that a busy signal will only appear when a given file is open.
// Default = `null`, meaning the busy signal applies to all files.
onlyForFile?: string;
// Is user waiting for computer to finish a task? (traditional busy spinner)
// or is the computer waiting for user to finish a task? (action required)
// Default = spinner.
waitingFor?: "computer" | "user";
// Debounce it? default = `true` for busy-signal, and false for action-required.
debounce?: boolean;
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
onDidClick?: () => void;
// If set to `true`, the busy signal tooltip will be immediately revealed
// when it first becomes visible (without explicit mouse interaction).
revealTooltip?: boolean;
}
export interface BusySignalService {
// Activates the busy signal with the given title and returns the promise
// from the provided callback.
// The busy signal automatically deactivates when the returned promise
// either resolves or rejects.
reportBusyWhile<T>(
title: string,
f: () => Promise<T>,
options?: BusySignalOptions
): Promise<T>;
export interface BusySignalService {
// Activates the busy signal with the given title and returns the promise
// from the provided callback.
// The busy signal automatically deactivates when the returned promise
// either resolves or rejects.
reportBusyWhile<T>(
title: string,
f: () => Promise<T>,
options?: BusySignalOptions
): Promise<T>;
// Activates the busy signal. Set the title in the returned BusySignal
// object (you can update the title multiple times) and dispose it when done.
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;
// Activates the busy signal. Set the title in the returned BusySignal
// object (you can update the title multiple times) and dispose it when done.
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;
// This is a no-op. When someone consumes the busy service, they get back a
// reference to the single shared instance, so disposing of it would be wrong.
dispose(): void;
}
// This is a no-op. When someone consumes the busy service, they get back a
// reference to the single shared instance, so disposing of it would be wrong.
dispose(): void;
}
export interface BusyMessage {
// You can set/update the title.
setTitle(title: string): void;
// Dispose of the signal when done to make it go away.
dispose(): void;
}
// }
export interface BusyMessage {
// You can set/update the title.
setTitle(title: string): void;
// Dispose of the signal when done to make it go away.
dispose(): void;
}
import * as Atom from "atom";
import { Message } from "atom/linter";
export interface CodeAction {
apply(): Promise<void>;
getTitle(): Promise<string>;
dispose(): void;
}
export interface CodeAction {
apply(): Promise<void>;
getTitle(): Promise<string>;
dispose(): void;
}
export interface CodeActionProvider {
grammarScopes?: ReadonlyArray<string>;
priority: number;
getCodeActions(
editor: Atom.TextEditor,
range: Atom.Range,
diagnostics: Message[]
): Promise<CodeAction[] | null | undefined>;
}
export interface CodeActionProvider {
grammarScopes?: ReadonlyArray<string>;
priority: number;
getCodeActions(
editor: Atom.TextEditor,
range: Atom.Range,
diagnostics: Message[]
): Promise<CodeAction[] | null | undefined>;
}
/**
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
* extended to provide a stream of CodeActions based on the cursor position.
*/
export interface CodeActionFetcher {
getCodeActionForDiagnostic: (
diagnostic: Message,
editor: Atom.TextEditor
) => Promise<CodeAction[]>;
}
/**
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
* extended to provide a stream of CodeActions based on the cursor position.
*/
export interface CodeActionFetcher {
getCodeActionForDiagnostic: (
diagnostic: Message,
editor: Atom.TextEditor
) => Promise<CodeAction[]>;
}
import * as Atom from "atom";
export interface CodeHighlightProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
highlight(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Atom.Range[] | undefined | null>;
}
export interface CodeHighlightProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
highlight(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Atom.Range[] | undefined | null>;
}
import * as Atom from "atom";
export interface DatatipService {
addProvider(provider: DatatipProvider): Atom.DisposableLike;
addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike;
createPinnedDataTip(
datatip: Datatip,
editor: Atom.TextEditor,
options?: PinnedDatatipOptions
): Atom.DisposableLike;
}
export interface DatatipService {
addProvider(provider: DatatipProvider): Atom.DisposableLike;
addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike;
createPinnedDataTip(
datatip: Datatip,
editor: Atom.TextEditor,
options?: PinnedDatatipOptions
): Atom.DisposableLike;
}
export interface PinnedDatatipOptions {
// Defaults to 'end-of-line'.
position?: PinnedDatatipPosition;
// Defaults to true.
showRangeHighlight?: boolean;
}
export interface PinnedDatatipOptions {
// Defaults to 'end-of-line'.
position?: PinnedDatatipPosition;
// Defaults to true.
showRangeHighlight?: boolean;
}
export type PinnedDatatipPosition = "end-of-line" | "above-range";
export type PinnedDatatipPosition = "end-of-line" | "above-range";
export interface DatatipProvider {
priority: number;
grammarScopes?: ReadonlyArray<string>;
// A unique name for the provider to be used for analytics.
// It is recommended that it be the name of the provider's package.
providerName: string;
datatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Datatip | undefined | null>;
}
export interface DatatipProvider {
priority: number;
grammarScopes?: ReadonlyArray<string>;
// A unique name for the provider to be used for analytics.
// It is recommended that it be the name of the provider's package.
providerName: string;
datatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Datatip | undefined | null>;
}
export interface ModifierDatatipProvider {
priority: number;
grammarScopes?: string[];
providerName: string;
modifierDatatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point,
heldKeys: Set<ModifierKey>
): Promise<Datatip | undefined | null>;
}
export interface ModifierDatatipProvider {
priority: number;
grammarScopes?: string[];
providerName: string;
modifierDatatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point,
heldKeys: Set<ModifierKey>
): Promise<Datatip | undefined | null>;
}
export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;
export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;
export type Datatip =
| {
markedStrings: MarkedString[];
range: Atom.Range;
pinnable?: boolean;
}
| {
component: () => JSX.Element; // React component
range: Atom.Range;
pinnable?: boolean;
};
export type Datatip =
| {
markedStrings: MarkedString[];
range: Atom.Range;
pinnable?: boolean;
}
| {
component: () => JSX.Element; // React component
range: Atom.Range;
pinnable?: boolean;
};
// Borrowed from the LSP API.
export type MarkedString =
| {
type: "markdown";
value: string;
}
| {
type: "snippet";
grammar: Atom.Grammar;
value: string;
};
// Borrowed from the LSP API.
export type MarkedString =
| {
type: "markdown";
value: string;
}
| {
type: "snippet";
grammar: Atom.Grammar;
value: string;
};
export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";
export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";
import * as Atom from "atom";
export interface Definition {
// Path of the file in which the definition is located.
path: string;
// First character of the definition's identifier.
// e.g. "F" in `class Foo {}`
position: Atom.Point;
// Optional: the range of the entire definition.
// e.g. "c" to "}" in `class Foo {}`
range?: Atom.Range;
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
// inside of Hyperclick when there are multiple definitions.
name?: string;
// If provided, `projectRoot` will be used to display a relativized version of `path`.
projectRoot?: string;
// `language` may be used by consumers to identify the source of definitions.
language: string;
}
export interface Definition {
// Path of the file in which the definition is located.
path: string;
// First character of the definition's identifier.
// e.g. "F" in `class Foo {}`
position: Atom.Point;
// Optional: the range of the entire definition.
// e.g. "c" to "}" in `class Foo {}`
range?: Atom.Range;
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
// inside of Hyperclick when there are multiple definitions.
name?: string;
// If provided, `projectRoot` will be used to display a relativized version of `path`.
projectRoot?: string;
// `language` may be used by consumers to identify the source of definitions.
language: string;
}
// Definition queries supply a point.
// The returned queryRange is the range within which the returned definition is valid.
// Typically queryRange spans the containing identifier around the query point.
// (If a null queryRange is returned, the range of the word containing the point is used.)
export interface DefinitionQueryResult {
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
definitions: ReadonlyArray<Definition>; // Must be non-empty.
}
// Definition queries supply a point.
// The returned queryRange is the range within which the returned definition is valid.
// Typically queryRange spans the containing identifier around the query point.
// (If a null queryRange is returned, the range of the word containing the point is used.)
export interface DefinitionQueryResult {
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
definitions: ReadonlyArray<Definition>; // Must be non-empty.
}
// Provides definitions for a set of language grammars.
export interface DefinitionProvider {
// If there are multiple providers for a given grammar,
// the one with the highest priority will be used.
priority: number;
grammarScopes: ReadonlyArray<string>;
wordRegExp: RegExp | null | undefined;
// Obtains the definition in an editor at the given point.
// This should return null if no definition is available.
getDefinition: (
editor: Atom.TextEditor,
position: Atom.Point
) => Promise<DefinitionQueryResult | null | undefined>;
}
// Provides definitions for a set of language grammars.
export interface DefinitionProvider {
// If there are multiple providers for a given grammar,
// the one with the highest priority will be used.
priority: number;
grammarScopes: ReadonlyArray<string>;
wordRegExp: RegExp | null | undefined;
// Obtains the definition in an editor at the given point.
// This should return null if no definition is available.
getDefinition: (
editor: Atom.TextEditor,
position: Atom.Point
) => Promise<DefinitionQueryResult | null | undefined>;
}
export interface DefinitionPreviewProvider {
getDefinitionPreview(
definition: Definition
): Promise<
| {
mime: string;
contents: string;
encoding: string;
}
| null
| undefined
>;
}
export interface DefinitionPreviewProvider {
getDefinitionPreview(
definition: Definition
): Promise<
| {
mime: string;
contents: string;
encoding: string;
}
| null
| undefined
>;
}
import * as Atom from "atom";
export interface FindReferencesProvider {
// Return true if your provider supports finding references for the provided Atom.TextEditor.
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;
export interface FindReferencesProvider {
// Return true if your provider supports finding references for the provided Atom.TextEditor.
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;
// `findReferences` will only be called if `isEditorSupported` previously returned true
// for the given Atom.TextEditor.
findReferences(
editor: Atom.TextEditor,
position: Atom.Point
): Promise<FindReferencesReturn | undefined | null>;
}
// `findReferences` will only be called if `isEditorSupported` previously returned true
// for the given Atom.TextEditor.
findReferences(
editor: Atom.TextEditor,
position: Atom.Point
): Promise<FindReferencesReturn | undefined | null>;
}
export interface Reference {
uri: string; // Nuclide URI of the file path
name: string | undefined | null; // name of calling method/function/symbol
range: Atom.Range;
}
export interface Reference {
uri: string; // Nuclide URI of the file path
name: string | undefined | null; // name of calling method/function/symbol
range: Atom.Range;
}
export interface FindReferencesData {
type: "data";
baseUri: string;
referencedSymbolName: string;
references: Reference[];
title?: string; // defaults to 'Symbol References'
}
export interface FindReferencesData {
type: "data";
baseUri: string;
referencedSymbolName: string;
references: Reference[];
title?: string; // defaults to 'Symbol References'
}
export interface FindReferencesError {
type: "error";
message: string;
}
export interface FindReferencesError {
type: "error";
message: string;
}
export type FindReferencesReturn = FindReferencesData | FindReferencesError;
export type FindReferencesReturn = FindReferencesData | FindReferencesError;
import * as Atom from "atom";
export interface HyperclickProvider {
// Use this to provide a suggestion for single-word matches.
// Optionally set `wordRegExp` to adjust word-matching.
getSuggestionForWord?: (
textEditor: Atom.TextEditor,
text: string,
range: Atom.Range
) => Promise<HyperclickSuggestion | null | undefined>;
export interface HyperclickProvider {
// Use this to provide a suggestion for single-word matches.
// Optionally set `wordRegExp` to adjust word-matching.
getSuggestionForWord?: (
textEditor: Atom.TextEditor,
text: string,
range: Atom.Range
) => Promise<HyperclickSuggestion | null | undefined>;
wordRegExp?: RegExp;
wordRegExp?: RegExp;
// Use this to provide a suggestion if it can have non-contiguous ranges.
// A primary use-case for this is Objective-C methods.
getSuggestion?: (
textEditor: Atom.TextEditor,
position: Atom.Point
) => Promise<HyperclickSuggestion | null | undefined>;
// Use this to provide a suggestion if it can have non-contiguous ranges.
// A primary use-case for this is Objective-C methods.
getSuggestion?: (
textEditor: Atom.TextEditor,
position: Atom.Point
) => Promise<HyperclickSuggestion | null | undefined>;
// Must be unique. Used for analytics.
providerName?: string;
// Must be unique. Used for analytics.
providerName?: string;
// The higher this is, the more precedence the provider gets.
priority: number;
// The higher this is, the more precedence the provider gets.
priority: number;
// Optionally, limit the set of grammar scopes the provider should apply to.
grammarScopes?: string[];
}
// Optionally, limit the set of grammar scopes the provider should apply to.
grammarScopes?: string[];
}
export interface HyperclickSuggestion {
// The range(s) to underline to provide as a visual cue for clicking.
range: Atom.Range | Atom.Range[];
export interface HyperclickSuggestion {
// The range(s) to underline to provide as a visual cue for clicking.
range: Atom.Range | Atom.Range[];
// The function to call when the underlined text is clicked.
callback:
| (() => void)
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
}
// The function to call when the underlined text is clicked.
callback:
| (() => void)
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
}
// atom-ide
// https://github.com/atom-ide-community/atom-ide-base
export * from "./busy-signal"
export * from "./code-actions"
export * from "./code-highlight"
export * from "./datatip"
export * from "./definitions"
export * from "./find-references"
export * from "./hyperclick"
export * from "./outline"
export * from "./sig-help"
export * from "./busy-signal";
export * from "./code-actions";
export * from "./code-highlight";
export * from "./datatip";
export * from "./definitions";
export * from "./find-references";
export * from "./hyperclick";
export * from "./outline";
export * from "./sig-help";
import * as Atom from "atom";
export interface OutlineProvider {
name: string;
// If there are multiple providers for a given grammar, the one with the highest priority will be
// used.
priority: number;
grammarScopes: ReadonlyArray<string>;
updateOnEdit?: boolean;
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
}
export interface OutlineProvider {
name: string;
// If there are multiple providers for a given grammar, the one with the highest priority will be
// used.
priority: number;
grammarScopes: ReadonlyArray<string>;
updateOnEdit?: boolean;
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
}
export interface OutlineTree {
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
kind?: OutlineTreeKind; // kind you can pass to the UI for theming
export interface OutlineTree {
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
kind?: OutlineTreeKind; // kind you can pass to the UI for theming
// Must be one or the other. If both are present, tokenizedText is preferred.
plainText?: string;
tokenizedText?: TokenizedText;
// Must be one or the other. If both are present, tokenizedText is preferred.
plainText?: string;
tokenizedText?: TokenizedText;
// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
representativeName?: string;
// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
representativeName?: string;
startPosition: Atom.Point;
endPosition?: Atom.Point;
landingPosition?: Atom.Point;
children: OutlineTree[];
}
startPosition: Atom.Point;
endPosition?: Atom.Point;
landingPosition?: Atom.Point;
children: OutlineTree[];
}
export interface Outline {
outlineTrees: OutlineTree[];
}
export interface Outline {
outlineTrees: OutlineTree[];
}
// Kind of outline tree - matches the names from the Language Server Protocol v2.
export type OutlineTreeKind =
| "file"
| "module"
| "namespace"
| "package"
| "class"
| "method"
| "property"
| "field"
| "constructor"
| "enum"
| "interface"
| "function"
| "variable"
| "constant"
| "string"
| "number"
| "boolean"
| "array";
// Kind of outline tree - matches the names from the Language Server Protocol v2.
export type OutlineTreeKind =
| "file"
| "module"
| "namespace"
| "package"
| "class"
| "method"
| "property"
| "field"
| "constructor"
| "enum"
| "interface"
| "function"
| "variable"
| "constant"
| "string"
| "number"
| "boolean"
| "array";
export type TokenKind =
| "keyword"
| "class-name"
| "constructor"
| "method"
| "param"
| "string"
| "whitespace"
| "plain"
| "type";
export type TokenKind =
| "keyword"
| "class-name"
| "constructor"
| "method"
| "param"
| "string"
| "whitespace"
| "plain"
| "type";
export interface TextToken {
kind: TokenKind;
value: string;
}
export interface TextToken {
kind: TokenKind;
value: string;
}
export type TokenizedText = TextToken[];
export type TokenizedText = TextToken[];
import { DisposableLike, Point, TextEditor } from "atom";
export type SignatureHelpRegistry = (
provider: SignatureHelpProvider
) => DisposableLike;
export type SignatureHelpRegistry = (
provider: SignatureHelpProvider
) => DisposableLike;
export interface SignatureHelpProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
export interface SignatureHelpProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
triggerCharacters?: Set<string>;
triggerCharacters?: Set<string>;
getSignatureHelp(
editor: TextEditor,
point: Point
): Promise<SignatureHelp | undefined | null>;
}
getSignatureHelp(
editor: TextEditor,
point: Point
): Promise<SignatureHelp | undefined | null>;
}
export interface SignatureHelp {
signatures: Signature[];
activeSignature?: number;
activeParameter?: number;
}
export interface SignatureHelp {
signatures: Signature[];
activeSignature?: number;
activeParameter?: number;
}
export interface Signature {
label: string;
documentation?: string;
parameters?: SignatureParameter[];
}
export interface Signature {
label: string;
documentation?: string;
parameters?: SignatureParameter[];
}
export interface SignatureParameter {
label: string;
documentation?: string;
}
export interface SignatureParameter {
label: string;
documentation?: string;
}
{
"name": "atom-ide-base",
"main": "dist/main.js",
"version": "1.1.0",
"version": "1.1.1",
"author": "atom-ide-community",

@@ -6,0 +6,0 @@ "description": "Atom IDE packages for Atom",

@@ -31,3 +31,5 @@ # atom-ide-base

## Using Types
Install the packages as an npm package:
```

@@ -38,7 +40,8 @@ npm install --save-dev atom-ide-base

Then import the types like the following:
```ts
import {BusySignalServie} from "atom-ide-base"
import { BusySignalServie } from "atom-ide-base";
```
See the "*.d.ts" files to become familiar with the API.
See the "\*.d.ts" files to become familiar with the API.

@@ -45,0 +48,0 @@ ## Contributing

@@ -0,0 +0,0 @@ const { execSync } = require("child_process");

@@ -19,3 +19,3 @@ describe("Benchmark", () => {

"linter-ui-default",
"intentions"
"intentions",
];

@@ -22,0 +22,0 @@ deps.forEach(async (p) => await atom.packages.activatePackage(p));

describe("tests", () => {
const deps = [

@@ -12,3 +11,3 @@ "atom-ide-markdown-service",

"linter-ui-default",
"intentions"
"intentions",
];

@@ -27,4 +26,2 @@

await atom.packages.activatePackage("atom-ide-base");
});

@@ -34,7 +31,6 @@

expect(atom.packages.isPackageLoaded("atom-ide-base")).toBeTruthy();
const allDeps = atom.packages.getAvailablePackageNames()
deps.forEach(dep => {
expect(allDeps.includes(dep)).toBeTruthy()
const allDeps = atom.packages.getAvailablePackageNames();
deps.forEach((dep) => {
expect(allDeps.includes(dep)).toBeTruthy();
});
});

@@ -44,8 +40,7 @@

expect(atom.packages.isPackageLoaded("atom-ide-base")).toBeTruthy();
deps.forEach(async dep => {
deps.forEach(async (dep) => {
await atom.packages.activatePackage(dep);
expect(atom.packages.isPackageLoaded(dep)).toBeTruthy()
expect(atom.packages.isPackageLoaded(dep)).toBeTruthy();
});
});
});

@@ -1,45 +0,43 @@

// declare module "atom-ide-base" {
export interface BusySignalOptions {
// Can say that a busy signal will only appear when a given file is open.
// Default = `null`, meaning the busy signal applies to all files.
onlyForFile?: string;
// Is user waiting for computer to finish a task? (traditional busy spinner)
// or is the computer waiting for user to finish a task? (action required)
// Default = spinner.
waitingFor?: "computer" | "user";
// Debounce it? default = `true` for busy-signal, and false for action-required.
debounce?: boolean;
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
onDidClick?: () => void;
// If set to `true`, the busy signal tooltip will be immediately revealed
// when it first becomes visible (without explicit mouse interaction).
revealTooltip?: boolean;
}
export interface BusySignalOptions {
// Can say that a busy signal will only appear when a given file is open.
// Default = `null`, meaning the busy signal applies to all files.
onlyForFile?: string;
// Is user waiting for computer to finish a task? (traditional busy spinner)
// or is the computer waiting for user to finish a task? (action required)
// Default = spinner.
waitingFor?: "computer" | "user";
// Debounce it? default = `true` for busy-signal, and false for action-required.
debounce?: boolean;
// If `onClick` is set, then the tooltip will be clickable. Default = `null`.
onDidClick?: () => void;
// If set to `true`, the busy signal tooltip will be immediately revealed
// when it first becomes visible (without explicit mouse interaction).
revealTooltip?: boolean;
}
export interface BusySignalService {
// Activates the busy signal with the given title and returns the promise
// from the provided callback.
// The busy signal automatically deactivates when the returned promise
// either resolves or rejects.
reportBusyWhile<T>(
title: string,
f: () => Promise<T>,
options?: BusySignalOptions
): Promise<T>;
export interface BusySignalService {
// Activates the busy signal with the given title and returns the promise
// from the provided callback.
// The busy signal automatically deactivates when the returned promise
// either resolves or rejects.
reportBusyWhile<T>(
title: string,
f: () => Promise<T>,
options?: BusySignalOptions
): Promise<T>;
// Activates the busy signal. Set the title in the returned BusySignal
// object (you can update the title multiple times) and dispose it when done.
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;
// Activates the busy signal. Set the title in the returned BusySignal
// object (you can update the title multiple times) and dispose it when done.
reportBusy(title: string, options?: BusySignalOptions): BusyMessage;
// This is a no-op. When someone consumes the busy service, they get back a
// reference to the single shared instance, so disposing of it would be wrong.
dispose(): void;
}
// This is a no-op. When someone consumes the busy service, they get back a
// reference to the single shared instance, so disposing of it would be wrong.
dispose(): void;
}
export interface BusyMessage {
// You can set/update the title.
setTitle(title: string): void;
// Dispose of the signal when done to make it go away.
dispose(): void;
}
// }
export interface BusyMessage {
// You can set/update the title.
setTitle(title: string): void;
// Dispose of the signal when done to make it go away.
dispose(): void;
}
import * as Atom from "atom";
import { Message } from "atom/linter";
export interface CodeAction {
apply(): Promise<void>;
getTitle(): Promise<string>;
dispose(): void;
}
export interface CodeAction {
apply(): Promise<void>;
getTitle(): Promise<string>;
dispose(): void;
}
export interface CodeActionProvider {
grammarScopes?: ReadonlyArray<string>;
priority: number;
getCodeActions(
editor: Atom.TextEditor,
range: Atom.Range,
diagnostics: Message[]
): Promise<CodeAction[] | null | undefined>;
}
export interface CodeActionProvider {
grammarScopes?: ReadonlyArray<string>;
priority: number;
getCodeActions(
editor: Atom.TextEditor,
range: Atom.Range,
diagnostics: Message[]
): Promise<CodeAction[] | null | undefined>;
}
/**
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
* extended to provide a stream of CodeActions based on the cursor position.
*/
export interface CodeActionFetcher {
getCodeActionForDiagnostic: (
diagnostic: Message,
editor: Atom.TextEditor
) => Promise<CodeAction[]>;
}
/**
* atom-ide-base-code-actions provides a CodeActionFetcher which offers an API to
* request CodeActions from all CodeAction providers. For now, CodeActionFetcher
* can only fetch CodeActions for a Diagnostic. In the future, this API can be
* extended to provide a stream of CodeActions based on the cursor position.
*/
export interface CodeActionFetcher {
getCodeActionForDiagnostic: (
diagnostic: Message,
editor: Atom.TextEditor
) => Promise<CodeAction[]>;
}
import * as Atom from "atom";
export interface CodeHighlightProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
highlight(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Atom.Range[] | undefined | null>;
}
export interface CodeHighlightProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
highlight(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Atom.Range[] | undefined | null>;
}
import * as Atom from "atom";
export interface DatatipService {
addProvider(provider: DatatipProvider): Atom.DisposableLike;
addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike;
createPinnedDataTip(
datatip: Datatip,
editor: Atom.TextEditor,
options?: PinnedDatatipOptions
): Atom.DisposableLike;
}
export interface DatatipService {
addProvider(provider: DatatipProvider): Atom.DisposableLike;
addModifierProvider(provider: ModifierDatatipProvider): Atom.DisposableLike;
createPinnedDataTip(
datatip: Datatip,
editor: Atom.TextEditor,
options?: PinnedDatatipOptions
): Atom.DisposableLike;
}
export interface PinnedDatatipOptions {
// Defaults to 'end-of-line'.
position?: PinnedDatatipPosition;
// Defaults to true.
showRangeHighlight?: boolean;
}
export interface PinnedDatatipOptions {
// Defaults to 'end-of-line'.
position?: PinnedDatatipPosition;
// Defaults to true.
showRangeHighlight?: boolean;
}
export type PinnedDatatipPosition = "end-of-line" | "above-range";
export type PinnedDatatipPosition = "end-of-line" | "above-range";
export interface DatatipProvider {
priority: number;
grammarScopes?: ReadonlyArray<string>;
// A unique name for the provider to be used for analytics.
// It is recommended that it be the name of the provider's package.
providerName: string;
datatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Datatip | undefined | null>;
}
export interface DatatipProvider {
priority: number;
grammarScopes?: ReadonlyArray<string>;
// A unique name for the provider to be used for analytics.
// It is recommended that it be the name of the provider's package.
providerName: string;
datatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point
): Promise<Datatip | undefined | null>;
}
export interface ModifierDatatipProvider {
priority: number;
grammarScopes?: string[];
providerName: string;
modifierDatatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point,
heldKeys: Set<ModifierKey>
): Promise<Datatip | undefined | null>;
}
export interface ModifierDatatipProvider {
priority: number;
grammarScopes?: string[];
providerName: string;
modifierDatatip(
editor: Atom.TextEditor,
bufferPosition: Atom.Point,
heldKeys: Set<ModifierKey>
): Promise<Datatip | undefined | null>;
}
export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;
export type AnyDatatipProvider = DatatipProvider | ModifierDatatipProvider;
export type Datatip =
| {
markedStrings: MarkedString[];
range: Atom.Range;
pinnable?: boolean;
}
| {
component: () => JSX.Element; // React component
range: Atom.Range;
pinnable?: boolean;
};
export type Datatip =
| {
markedStrings: MarkedString[];
range: Atom.Range;
pinnable?: boolean;
}
| {
component: () => JSX.Element; // React component
range: Atom.Range;
pinnable?: boolean;
};
// Borrowed from the LSP API.
export type MarkedString =
| {
type: "markdown";
value: string;
}
| {
type: "snippet";
grammar: Atom.Grammar;
value: string;
};
// Borrowed from the LSP API.
export type MarkedString =
| {
type: "markdown";
value: string;
}
| {
type: "snippet";
grammar: Atom.Grammar;
value: string;
};
export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";
export type ModifierKey = "metaKey" | "shiftKey" | "altKey" | "ctrlKey";
import * as Atom from "atom";
export interface Definition {
// Path of the file in which the definition is located.
path: string;
// First character of the definition's identifier.
// e.g. "F" in `class Foo {}`
position: Atom.Point;
// Optional: the range of the entire definition.
// e.g. "c" to "}" in `class Foo {}`
range?: Atom.Range;
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
// inside of Hyperclick when there are multiple definitions.
name?: string;
// If provided, `projectRoot` will be used to display a relativized version of `path`.
projectRoot?: string;
// `language` may be used by consumers to identify the source of definitions.
language: string;
}
export interface Definition {
// Path of the file in which the definition is located.
path: string;
// First character of the definition's identifier.
// e.g. "F" in `class Foo {}`
position: Atom.Point;
// Optional: the range of the entire definition.
// e.g. "c" to "}" in `class Foo {}`
range?: Atom.Range;
// Optional: `name` and `projectRoot` can be provided to display a more human-readable title
// inside of Hyperclick when there are multiple definitions.
name?: string;
// If provided, `projectRoot` will be used to display a relativized version of `path`.
projectRoot?: string;
// `language` may be used by consumers to identify the source of definitions.
language: string;
}
// Definition queries supply a point.
// The returned queryRange is the range within which the returned definition is valid.
// Typically queryRange spans the containing identifier around the query point.
// (If a null queryRange is returned, the range of the word containing the point is used.)
export interface DefinitionQueryResult {
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
definitions: ReadonlyArray<Definition>; // Must be non-empty.
}
// Definition queries supply a point.
// The returned queryRange is the range within which the returned definition is valid.
// Typically queryRange spans the containing identifier around the query point.
// (If a null queryRange is returned, the range of the word containing the point is used.)
export interface DefinitionQueryResult {
queryRange: ReadonlyArray<Atom.Range> | null | undefined;
definitions: ReadonlyArray<Definition>; // Must be non-empty.
}
// Provides definitions for a set of language grammars.
export interface DefinitionProvider {
// If there are multiple providers for a given grammar,
// the one with the highest priority will be used.
priority: number;
grammarScopes: ReadonlyArray<string>;
wordRegExp: RegExp | null | undefined;
// Obtains the definition in an editor at the given point.
// This should return null if no definition is available.
getDefinition: (
editor: Atom.TextEditor,
position: Atom.Point
) => Promise<DefinitionQueryResult | null | undefined>;
}
// Provides definitions for a set of language grammars.
export interface DefinitionProvider {
// If there are multiple providers for a given grammar,
// the one with the highest priority will be used.
priority: number;
grammarScopes: ReadonlyArray<string>;
wordRegExp: RegExp | null | undefined;
// Obtains the definition in an editor at the given point.
// This should return null if no definition is available.
getDefinition: (
editor: Atom.TextEditor,
position: Atom.Point
) => Promise<DefinitionQueryResult | null | undefined>;
}
export interface DefinitionPreviewProvider {
getDefinitionPreview(
definition: Definition
): Promise<
| {
mime: string;
contents: string;
encoding: string;
}
| null
| undefined
>;
}
export interface DefinitionPreviewProvider {
getDefinitionPreview(
definition: Definition
): Promise<
| {
mime: string;
contents: string;
encoding: string;
}
| null
| undefined
>;
}
import * as Atom from "atom";
export interface FindReferencesProvider {
// Return true if your provider supports finding references for the provided Atom.TextEditor.
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;
export interface FindReferencesProvider {
// Return true if your provider supports finding references for the provided Atom.TextEditor.
isEditorSupported(editor: Atom.TextEditor): Promise<boolean>;
// `findReferences` will only be called if `isEditorSupported` previously returned true
// for the given Atom.TextEditor.
findReferences(
editor: Atom.TextEditor,
position: Atom.Point
): Promise<FindReferencesReturn | undefined | null>;
}
// `findReferences` will only be called if `isEditorSupported` previously returned true
// for the given Atom.TextEditor.
findReferences(
editor: Atom.TextEditor,
position: Atom.Point
): Promise<FindReferencesReturn | undefined | null>;
}
export interface Reference {
uri: string; // Nuclide URI of the file path
name: string | undefined | null; // name of calling method/function/symbol
range: Atom.Range;
}
export interface Reference {
uri: string; // Nuclide URI of the file path
name: string | undefined | null; // name of calling method/function/symbol
range: Atom.Range;
}
export interface FindReferencesData {
type: "data";
baseUri: string;
referencedSymbolName: string;
references: Reference[];
title?: string; // defaults to 'Symbol References'
}
export interface FindReferencesData {
type: "data";
baseUri: string;
referencedSymbolName: string;
references: Reference[];
title?: string; // defaults to 'Symbol References'
}
export interface FindReferencesError {
type: "error";
message: string;
}
export interface FindReferencesError {
type: "error";
message: string;
}
export type FindReferencesReturn = FindReferencesData | FindReferencesError;
export type FindReferencesReturn = FindReferencesData | FindReferencesError;
import * as Atom from "atom";
export interface HyperclickProvider {
// Use this to provide a suggestion for single-word matches.
// Optionally set `wordRegExp` to adjust word-matching.
getSuggestionForWord?: (
textEditor: Atom.TextEditor,
text: string,
range: Atom.Range
) => Promise<HyperclickSuggestion | null | undefined>;
export interface HyperclickProvider {
// Use this to provide a suggestion for single-word matches.
// Optionally set `wordRegExp` to adjust word-matching.
getSuggestionForWord?: (
textEditor: Atom.TextEditor,
text: string,
range: Atom.Range
) => Promise<HyperclickSuggestion | null | undefined>;
wordRegExp?: RegExp;
wordRegExp?: RegExp;
// Use this to provide a suggestion if it can have non-contiguous ranges.
// A primary use-case for this is Objective-C methods.
getSuggestion?: (
textEditor: Atom.TextEditor,
position: Atom.Point
) => Promise<HyperclickSuggestion | null | undefined>;
// Use this to provide a suggestion if it can have non-contiguous ranges.
// A primary use-case for this is Objective-C methods.
getSuggestion?: (
textEditor: Atom.TextEditor,
position: Atom.Point
) => Promise<HyperclickSuggestion | null | undefined>;
// Must be unique. Used for analytics.
providerName?: string;
// Must be unique. Used for analytics.
providerName?: string;
// The higher this is, the more precedence the provider gets.
priority: number;
// The higher this is, the more precedence the provider gets.
priority: number;
// Optionally, limit the set of grammar scopes the provider should apply to.
grammarScopes?: string[];
}
// Optionally, limit the set of grammar scopes the provider should apply to.
grammarScopes?: string[];
}
export interface HyperclickSuggestion {
// The range(s) to underline to provide as a visual cue for clicking.
range: Atom.Range | Atom.Range[];
export interface HyperclickSuggestion {
// The range(s) to underline to provide as a visual cue for clicking.
range: Atom.Range | Atom.Range[];
// The function to call when the underlined text is clicked.
callback:
| (() => void)
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
}
// The function to call when the underlined text is clicked.
callback:
| (() => void)
| Array<{ rightLabel?: string; title: string; callback: () => void }>;
}
// atom-ide
// https://github.com/atom-ide-community/atom-ide-base
export * from "./busy-signal"
export * from "./code-actions"
export * from "./code-highlight"
export * from "./datatip"
export * from "./definitions"
export * from "./find-references"
export * from "./hyperclick"
export * from "./outline"
export * from "./sig-help"
export * from "./busy-signal";
export * from "./code-actions";
export * from "./code-highlight";
export * from "./datatip";
export * from "./definitions";
export * from "./find-references";
export * from "./hyperclick";
export * from "./outline";
export * from "./sig-help";

@@ -33,6 +33,6 @@ import { CompositeDisposable } from "atom";

"linter-ui-default",
"intentions"
"intentions",
];
if (deps.some((p) => !atom.packages.isPackageLoaded(p))) {
await import("atom-package-deps").then(({install}) => {
await import("atom-package-deps").then(({ install }) => {
// install if not installed

@@ -39,0 +39,0 @@ install("atom-ide-base", false);

import * as Atom from "atom";
export interface OutlineProvider {
name: string;
// If there are multiple providers for a given grammar, the one with the highest priority will be
// used.
priority: number;
grammarScopes: ReadonlyArray<string>;
updateOnEdit?: boolean;
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
}
export interface OutlineProvider {
name: string;
// If there are multiple providers for a given grammar, the one with the highest priority will be
// used.
priority: number;
grammarScopes: ReadonlyArray<string>;
updateOnEdit?: boolean;
getOutline(editor: Atom.TextEditor): Promise<Outline | null | undefined>;
}
export interface OutlineTree {
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
kind?: OutlineTreeKind; // kind you can pass to the UI for theming
export interface OutlineTree {
icon?: string; // from Atom.Octicon (that type's not allowed over rpc so we use string)
kind?: OutlineTreeKind; // kind you can pass to the UI for theming
// Must be one or the other. If both are present, tokenizedText is preferred.
plainText?: string;
tokenizedText?: TokenizedText;
// Must be one or the other. If both are present, tokenizedText is preferred.
plainText?: string;
tokenizedText?: TokenizedText;
// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
representativeName?: string;
// If user has atom-ide-base-outline-view.nameOnly then representativeName is used instead.
representativeName?: string;
startPosition: Atom.Point;
endPosition?: Atom.Point;
landingPosition?: Atom.Point;
children: OutlineTree[];
}
startPosition: Atom.Point;
endPosition?: Atom.Point;
landingPosition?: Atom.Point;
children: OutlineTree[];
}
export interface Outline {
outlineTrees: OutlineTree[];
}
export interface Outline {
outlineTrees: OutlineTree[];
}
// Kind of outline tree - matches the names from the Language Server Protocol v2.
export type OutlineTreeKind =
| "file"
| "module"
| "namespace"
| "package"
| "class"
| "method"
| "property"
| "field"
| "constructor"
| "enum"
| "interface"
| "function"
| "variable"
| "constant"
| "string"
| "number"
| "boolean"
| "array";
// Kind of outline tree - matches the names from the Language Server Protocol v2.
export type OutlineTreeKind =
| "file"
| "module"
| "namespace"
| "package"
| "class"
| "method"
| "property"
| "field"
| "constructor"
| "enum"
| "interface"
| "function"
| "variable"
| "constant"
| "string"
| "number"
| "boolean"
| "array";
export type TokenKind =
| "keyword"
| "class-name"
| "constructor"
| "method"
| "param"
| "string"
| "whitespace"
| "plain"
| "type";
export type TokenKind =
| "keyword"
| "class-name"
| "constructor"
| "method"
| "param"
| "string"
| "whitespace"
| "plain"
| "type";
export interface TextToken {
kind: TokenKind;
value: string;
}
export interface TextToken {
kind: TokenKind;
value: string;
}
export type TokenizedText = TextToken[];
export type TokenizedText = TextToken[];
import { DisposableLike, Point, TextEditor } from "atom";
export type SignatureHelpRegistry = (
provider: SignatureHelpProvider
) => DisposableLike;
export type SignatureHelpRegistry = (
provider: SignatureHelpProvider
) => DisposableLike;
export interface SignatureHelpProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
export interface SignatureHelpProvider {
priority: number;
grammarScopes: ReadonlyArray<string>;
triggerCharacters?: Set<string>;
triggerCharacters?: Set<string>;
getSignatureHelp(
editor: TextEditor,
point: Point
): Promise<SignatureHelp | undefined | null>;
}
getSignatureHelp(
editor: TextEditor,
point: Point
): Promise<SignatureHelp | undefined | null>;
}
export interface SignatureHelp {
signatures: Signature[];
activeSignature?: number;
activeParameter?: number;
}
export interface SignatureHelp {
signatures: Signature[];
activeSignature?: number;
activeParameter?: number;
}
export interface Signature {
label: string;
documentation?: string;
parameters?: SignatureParameter[];
}
export interface Signature {
label: string;
documentation?: string;
parameters?: SignatureParameter[];
}
export interface SignatureParameter {
label: string;
documentation?: string;
}
export interface SignatureParameter {
label: string;
documentation?: string;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc