Skip to content

Commit

Permalink
Update for js.lib on Haxe dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 committed Apr 17, 2019
1 parent 4210bdd commit e7856d6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/import.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#if haxe4
import js.lib.Error;
import js.lib.RegExp;
import js.lib.Promise.Thenable;
#else
import js.Error;
import js.RegExp;
import js.Promise.Thenable;
#end
import ts.ReadonlyArray;
import haxe.Constraints.Function;
import haxe.DynamicAccess;
Expand Down
8 changes: 7 additions & 1 deletion src/vscode/LanguageConfiguration.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package vscode;

#if haxe4
import js.lib.RegExp;
#else
import js.RegExp;
#end

/**
* The language configuration interfaces defines the contract between extensions
* and various editor features, like automatic bracket insertion, automatic indentation etc.
Expand All @@ -23,7 +29,7 @@ typedef LanguageConfiguration = {
* e.g.: A regex that matches anything except known separators (and dot is allowed to occur in a floating point number):
* /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
*/
@:optional var wordPattern:js.RegExp;
@:optional var wordPattern:RegExp;

/**
* The language's indentation settings.
Expand Down
8 changes: 7 additions & 1 deletion src/vscode/TextDocument.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package vscode;

#if haxe4
import js.lib.RegExp;
#else
import js.RegExp;
#end

/**
* Represents a text document, such as a source file. Text documents have
* [lines](#TextLine) and knowledge about an underlying resource like a file.
Expand Down Expand Up @@ -139,7 +145,7 @@ typedef TextDocument = {
* @param regex Optional regular expression that describes what a word is.
* @return A range spanning a word, or `undefined`.
*/
function getWordRangeAtPosition(position:Position, ?regex:js.RegExp):Null<Range>;
function getWordRangeAtPosition(position:Position, ?regex:RegExp):Null<Range>;

/**
* Ensure a range is completely contained in this document.
Expand Down

0 comments on commit e7856d6

Please sign in to comment.