File tree Expand file tree Collapse file tree 14 files changed +165
-21
lines changed
Expand file tree Collapse file tree 14 files changed +165
-21
lines changed Original file line number Diff line number Diff line change 22
33- Fix atom-package-deps issues (#60 )
44-
5+
56### 2.3.4
67
78- Fix copying from overlays on MacOS (#58 )
Original file line number Diff line number Diff line change 1+ import type { IdeUri } from "./uri"
2+
13export interface BusySignalOptions {
24 /**
35 * Can say that a busy signal will only appear when a given file is open.
46 * Default = `null`, meaning the busy signal applies to all files.
57 */
6- onlyForFile ?: string
8+ onlyForFile ?: IdeUri
79
810 /**
911 * Is user waiting for computer to finish a task? (traditional busy spinner)
1012 * or is the computer waiting for user to finish a task? (action required)
11- * Default = `" computer"`.
13+ * @defaultValue `' computer'`
1214 */
1315 waitingFor ?: "computer" | "user"
1416
1517 /**
16- * Debounce it? default = `true` for busy-signal, and false for action-required.
18+ * Debounce it? default = `true` for busy-signal, and ` false` for action-required.
1719 */
1820 debounce ?: boolean
1921
2022 /**
21- * If `onClick` is set, then the tooltip will be clickable. Default = `null`.
23+ * If `onClick` is set, then the tooltip will be clickable.
24+ * @defaultValue `null`
2225 */
2326 onDidClick ?: ( ) => void
2427
Original file line number Diff line number Diff line change 11import * as Atom from "atom"
22import { Message } from "atom/linter"
3+ // TODO add code action support to Atom linter?
4+
5+ export type DiagnosticType = "Error" | "Warning" | "Info"
6+
7+ export interface Diagnostic {
8+ providerName : string
9+ type : DiagnosticType
10+ filePath : string
11+ text ?: string
12+ range : Atom . Range
13+ }
314
415export interface CodeAction {
516 apply ( ) : Promise < void >
@@ -13,7 +24,7 @@ export interface CodeActionProvider {
1324 getCodeActions (
1425 editor : Atom . TextEditor ,
1526 range : Atom . Range ,
16- diagnostics : Message [ ]
27+ diagnostics : Diagnostic [ ] // | Message[]
1728 ) : Promise < CodeAction [ ] | null | undefined >
1829}
1930
@@ -24,5 +35,5 @@ export interface CodeActionProvider {
2435 * extended to provide a stream of CodeActions based on the cursor position.
2536 */
2637export interface CodeActionFetcher {
27- getCodeActionForDiagnostic : ( diagnostic : Message , editor : Atom . TextEditor ) => Promise < CodeAction [ ] >
38+ getCodeActionForDiagnostic : ( diagnostic : Diagnostic /* | Message */ , editor : Atom . TextEditor ) => Promise < CodeAction [ ] >
2839}
Original file line number Diff line number Diff line change 1+ import type { TextEditor , Point , Range } from "atom"
2+ import type { TextEdit } from "./text-edit"
3+
4+ export interface FileCodeFormatProvider {
5+ formatEntireFile : ( editor : TextEditor , range : Range ) => Promise < TextEdit [ ] >
6+ priority : number
7+ grammarScopes : string [ ]
8+ }
9+
10+ export interface RangeCodeFormatProvider {
11+ formatCode : ( editor : TextEditor , range : Range ) => Promise < TextEdit [ ] >
12+ priority : number
13+ grammarScopes : string [ ]
14+ }
15+
16+ export interface OnSaveCodeFormatProvider {
17+ formatOnSave : ( editor : TextEditor ) => Promise < TextEdit [ ] >
18+ priority : number
19+ grammarScopes : string [ ]
20+ }
21+
22+ export interface OnTypeCodeFormatProvider {
23+ formatAtPosition : ( editor : TextEditor , position : Point , character : string ) => Promise < TextEdit [ ] >
24+ priority : number
25+ grammarScopes : string [ ]
26+ }
Original file line number Diff line number Diff line change 1+ export interface SourceInfo {
2+ id : string
3+ name : string
4+ start ?: ( ) => void
5+ stop ?: ( ) => void
6+ }
7+
8+ export type ConsoleService = ( options : SourceInfo ) => ConsoleApi
9+
10+ export interface ConsoleApi {
11+ setStatus ( status : OutputProviderStatus ) : void
12+ append ( message : Message ) : void
13+ dispose ( ) : void
14+ log ( object : string ) : void
15+ error ( object : string ) : void
16+ warn ( object : string ) : void
17+ info ( object : string ) : void
18+ }
19+
20+ export type OutputProviderStatus = "starting" | "running" | "stopped"
21+
22+ export interface Message {
23+ text : string
24+ level : Level
25+ tags ?: string [ ] | null
26+ kind ?: MessageKind | null
27+ scopeName ?: string | null
28+ }
29+
30+ export type TaskLevelType = "info" | "log" | "warning" | "error" | "debug" | "success"
31+ export type Level = TaskLevelType | Color
32+ type Color = "red" | "orange" | "yellow" | "green" | "blue" | "purple" | "violet" | "rainbow"
33+
34+ export type MessageKind = "message" | "request" | "response"
Original file line number Diff line number Diff line change @@ -21,13 +21,27 @@ export type PinnedDatatipPosition = "end-of-line" | "above-range"
2121
2222export interface DatatipProvider {
2323 priority : number
24- grammarScopes ?: ReadonlyArray < string >
24+
2525 /**
2626 * A unique name for the provider to be used for analytics.
2727 * It is recommended that it be the name of the provider's package.
2828 */
2929 providerName : string
30- datatip ( editor : Atom . TextEditor , bufferPosition : Atom . Point ) : Promise < Datatip | undefined | null >
30+ datatip (
31+ editor : Atom . TextEditor ,
32+ bufferPosition : Atom . Point ,
33+ /**
34+ * The mouse event that triggered the datatip.
35+ * This is null for manually toggled datatips.
36+ */
37+ mouseEvent ?: MouseEvent | null
38+ ) : Promise < Datatip | undefined | null >
39+
40+ /** Either pass this or `validForScope` */
41+ grammarScopes ?: ReadonlyArray < string >
42+
43+ /** Either pass `grammarScopes` or this function. */
44+ validForScope ?( scopeName : string ) : boolean
3145}
3246
3347export interface ModifierDatatipProvider {
Original file line number Diff line number Diff line change 11import * as Atom from "atom"
2+ import { IdeUri } from "./uri"
23
34export interface Definition {
45 /**
56 * Path of the file in which the definition is located.
67 */
7- path : string
8+ path : IdeUri
89 /**
910 * First character of the definition's identifier.
1011 * e.g. "F" in `class Foo {}`
@@ -23,7 +24,7 @@ export interface Definition {
2324 /**
2425 * If provided, `projectRoot` will be used to display a relativized version of `path`.
2526 */
26- projectRoot ?: string
27+ projectRoot ?: IdeUri
2728 /**
2829 * `language` may be used by consumers to identify the source of definitions.
2930 */
@@ -48,6 +49,7 @@ export interface DefinitionQueryResult {
4849 * Provides definitions for a set of language grammars.
4950 */
5051export interface DefinitionProvider {
52+ name : string
5153 /**
5254 * If there are multiple providers for a given grammar,
5355 * the one with the highest priority will be used.
Original file line number Diff line number Diff line change 11import * as Atom from "atom"
2+ import { IdeUri } from "./uri"
23
34export interface FindReferencesProvider {
45 /**
56 * Return true if your provider supports finding references for the provided Atom.TextEditor.
67 */
7- isEditorSupported ( editor : Atom . TextEditor ) : Promise < boolean >
8+ isEditorSupported ( editor : Atom . TextEditor ) : boolean | Promise < boolean >
89
910 /**
1011 * `findReferences` will only be called if `isEditorSupported` previously returned true
@@ -15,9 +16,9 @@ export interface FindReferencesProvider {
1516
1617export interface Reference {
1718 /**
18- * Nuclide URI of the file path
19+ * URI of the file path
1920 */
20- uri : string
21+ uri : IdeUri
2122 /**
2223 * name of calling method/function/symbol
2324 */
@@ -27,7 +28,7 @@ export interface Reference {
2728
2829export interface FindReferencesData {
2930 type : "data"
30- baseUri : string
31+ baseUri : IdeUri
3132 referencedSymbolName : string
3233 references : Reference [ ]
3334 /**
Original file line number Diff line number Diff line change 33 * @see https://github.com/atom-ide-community/atom-ide-base
44 */
55
6+ export * from "./uri"
67export * from "./busy-signal"
78export * from "./code-actions"
89export * from "./code-highlight"
@@ -13,6 +14,10 @@ export * from "./hyperclick"
1314export * from "./outline"
1415export * from "./sig-help"
1516export * from "./markdown-service"
17+ export * from "./code-format"
18+ export * from "./text-edit"
19+ export * from "./refactor"
20+ export * from "./console"
1621
1722import { BusySignalProvider } from "./busy-signal.d"
1823import { CodeActionProvider } from "./code-actions"
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface OutlineProvider {
1414
1515export interface OutlineTree {
1616 /**
17- * from Atom.Octicon (that type's not allowed over rpc so we use string)
17+ * from Atom.Octicon or Atom.OcticonsPrivate (types not allowed over rpc so we use string)
1818 */
1919 icon ?: string
2020 /**
@@ -23,9 +23,12 @@ export interface OutlineTree {
2323 kind ?: OutlineTreeKind
2424
2525 /**
26- * Must be one or the other . If both are present, tokenizedText is preferred.
26+ * Must have `plainText` or the `tokenizedText` property . If both are present, ` tokenizedText` is preferred.
2727 */
2828 plainText ?: string
29+ /**
30+ * Must have `plainText` or the `tokenizedText` property. If both are present, `tokenizedText` is preferred.
31+ */
2932 tokenizedText ?: TokenizedText
3033
3134 /**
You can’t perform that action at this time.
0 commit comments