forked from stkb/Rewrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add a Core.ts file. This is just for interfaces for the Core (F#) types. Move everything of that sort here. - Remove `rewrapSelection` function that converted vscode Selection objects to Fable ones, because Fable can now work with the former. - Other small formatting changes
- Loading branch information
Showing
7 changed files
with
80 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const Types = require('./core/Types') | ||
const Main = require('./core/Main') | ||
|
||
|
||
export interface CustomMarkers { line: string, block: [string, string] } | ||
export interface CustomMarkersStatic { | ||
new(line: string, block: string[]): CustomMarkers | ||
} | ||
|
||
export interface DocState { filePath: string, version: number, selections: Selection[] } | ||
|
||
export interface DocType { | ||
path: string | ||
language: string | ||
getMarkers: () => CustomMarkers | ||
} | ||
|
||
export interface Edit { | ||
startLine: number | ||
endLine: number | ||
lines: string[] | ||
selections: Selection[] | ||
} | ||
|
||
export interface Position { line: number, character: number } | ||
|
||
export interface Selection { anchor: Position, active: Position } | ||
|
||
export interface Settings { | ||
column: number | ||
tabWidth: number | ||
doubleSentenceSpacing: boolean | ||
reformat: boolean | ||
wholeComment: boolean | ||
} | ||
|
||
export const CustomMarkers: CustomMarkersStatic = Types.CustomMarkers | ||
|
||
/** Gets the current wrapping column used for the given document */ | ||
export const getWrappingColumn: (path: string, columns: number[]) => number = | ||
Main.getWrappingColumn | ||
|
||
export const maybeAutoWrap: | ||
(docType: DocType, settings: Settings, | ||
newText: string, pos: Position, docLine: (i:number) => string) => Edit = | ||
Main.maybeAutoWrap | ||
|
||
export const maybeChangeWrappingColumn: | ||
(docState: DocState, columns: number[]) => number = Main.maybeChangeWrappingColumn | ||
|
||
export const rewrap: | ||
(docType: DocType, settings: Settings, | ||
selections: Selection[], docLine: (i:number) => string) => Edit = | ||
Main.rewrap | ||
|
||
export const saveDocState: (docState: DocState) => void = Main.saveDocState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters