Example #1
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new HaXeSettings();
     if (!File.Exists(this.settingFilename))
     {
         this.SaveSettings();
     }
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (HaXeSettings)obj;
     }
 }
Example #2
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new HaXeSettings();
     if (!File.Exists(this.settingFilename))
     {
         this.SaveSettings();
     }
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (HaXeSettings)obj;
     }
     if (this.settingObject.HaXePath == null) // default values
     {
         string eVariable = System.Environment.GetEnvironmentVariable("HAXEPATH");
         settingObject.HaXePath = eVariable ?? @"C:\Program Files\Motion-Twin\haxe";
     }
     this.settingObject.OnClasspathChanged += SettingObjectOnClasspathChanged;
 }
Example #3
0
        public Context(HaXeSettings initSettings)
        {
            hxsettings = initSettings;
            hxsettings.Init();

            /* AS-LIKE OPTIONS */

            hasLevels = false;
            docType = "Void"; // "flash.display.MovieClip";

            stubFunctionClass = new ClassModel();
            stubFunctionClass.Name = stubFunctionClass.Type = "Function";
            stubFunctionClass.Flags = FlagType.Class;
            stubFunctionClass.Access = Visibility.Public;
            var funFile = new FileModel();
            funFile.Classes.Add(stubFunctionClass);
            stubFunctionClass.InFile = funFile;

            /* DESCRIBE LANGUAGE FEATURES */

            // language constructs
            features.hasPackages = true;
            features.hasFriendlyParentPackages = true;
            features.hasModules = true;
            features.hasImports = true;
            features.hasImportsWildcard = false;
            features.hasClasses = true;
            features.hasExtends = true;
            features.hasImplements = true;
            features.hasInterfaces = true;
            features.hasEnums = true;
            features.hasTypeDefs = true;
            features.hasGenerics = true;
            features.hasEcmaTyping = true;
            features.hasVars = true;
            features.hasConsts = false;
            features.hasMethods = true;
            features.hasStatics = true;
            features.hasTryCatch = true;
            features.hasInference = true;
            features.hasStringInterpolation = true;
            features.checkFileName = false;

            // haxe directives
            features.hasDirectives = true;
            features.Directives = new List<string>();
            features.Directives.Add("true");

            // allowed declarations access modifiers
            Visibility all = Visibility.Public | Visibility.Private;
            features.classModifiers = all;
            features.varModifiers = all;
            features.methodModifiers = all;

            // default declarations access modifiers
            features.classModifierDefault = Visibility.Public;
            features.enumModifierDefault = Visibility.Public;
            features.typedefModifierDefault = Visibility.Public;
            features.varModifierDefault = Visibility.Private;
            features.methodModifierDefault = Visibility.Private;

            // keywords
            features.dot = ".";
            features.voidKey = "Void";
            features.objectKey = "Dynamic";
            features.booleanKey = "Bool";
            features.numberKey = "Float";
            features.stringKey = "String";
            features.arrayKey = "Array<T>";
            features.importKey = "import";
            features.importKeyAlt = "using";
            features.typesPreKeys = new string[] { "import", "new", "extends", "implements", "using" };
            features.codeKeywords = new string[] {
                "var", "function", "new", "cast", "return", "break",
                "continue", "if", "else", "for", "while", "do", "switch", "case", "default", "$type",
                "null", "untyped", "true", "false", "try", "catch", "throw", "trace", "macro"
            };
            features.declKeywords = new string[] { "var", "function" };
            features.accessKeywords = new string[] { "extern", "inline", "dynamic", "macro", "override", "public", "private", "static" };
            features.typesKeywords = new string[] { "import", "using", "class", "interface", "typedef", "enum", "abstract" };
            features.varKey = "var";
            features.overrideKey = "override";
            features.functionKey = "function";
            features.staticKey = "static";
            features.publicKey = "public";
            features.privateKey = "private";
            features.intrinsicKey = "extern";
            features.inlineKey = "inline";
            features.hiddenPackagePrefix = '_';
            features.stringInterpolationQuotes = "'";

            /* INITIALIZATION */

            settings = initSettings;

            currentSDK = PathHelper.ResolvePath(hxsettings.GetDefaultSDK().Path) ?? "";
            initSettings.CompletionModeChanged += OnCompletionModeChange;
            //OnCompletionModeChange(); // defered to first use

            haxelibsCache = new Dictionary<string, List<string>>();
            //BuildClassPath(); // defered to first use
        }
Example #4
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new HaXeSettings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (HaXeSettings)obj;
     }
 }
Example #5
0
        public Context(HaXeSettings initSettings)
        {
            hxsettings = initSettings;
            hxsettings.Init();

            /* AS-LIKE OPTIONS */

            hasLevels = false;
            docType   = "Void"; // "flash.display.MovieClip";

            /* DESCRIBE LANGUAGE FEATURES */

            // language constructs
            features.hasPackages        = true;
            features.hasImports         = true;
            features.hasImportsWildcard = false;
            features.hasClasses         = true;
            features.hasExtends         = true;
            features.hasImplements      = true;
            features.hasInterfaces      = true;
            features.hasEnums           = true;
            features.hasTypeDefs        = true;
            features.hasGenerics        = true;
            features.hasEcmaTyping      = true;
            features.hasVars            = true;
            features.hasConsts          = false;
            features.hasMethods         = true;
            features.hasStatics         = true;
            features.hasTryCatch        = true;
            features.checkFileName      = false;

            // haxe directives
            features.hasDirectives = true;
            features.Directives    = new List <string>();
            features.Directives.Add("true");

            // allowed declarations access modifiers
            Visibility all = Visibility.Public | Visibility.Private;

            features.classModifiers  = all;
            features.varModifiers    = all;
            features.methodModifiers = all;

            // default declarations access modifiers
            features.classModifierDefault   = Visibility.Public;
            features.enumModifierDefault    = Visibility.Public;
            features.typedefModifierDefault = Visibility.Public;
            features.varModifierDefault     = Visibility.Private;
            features.methodModifierDefault  = Visibility.Private;

            // keywords
            features.dot          = ".";
            features.voidKey      = "Void";
            features.objectKey    = "Dynamic";
            features.importKey    = "import";
            features.importKeyAlt = "using";
            features.typesPreKeys = new string[] { "import", "new", "extends", "implements", "using" };
            features.codeKeywords = new string[] {
                "var", "function", "new", "cast", "return", "break", "continue", "callback",
                "if", "else", "for", "while", "do", "switch", "case", "default",
                "null", "untyped", "true", "false", "try", "catch", "throw", "inline", "dynamic"
            };
            features.varKey       = "var";
            features.overrideKey  = "override";
            features.functionKey  = "function";
            features.staticKey    = "static";
            features.publicKey    = "public";
            features.privateKey   = "private";
            features.intrinsicKey = "extern";
            features.inlineKey    = "inline";

            /* INITIALIZATION */

            settings      = initSettings;
            haxelibsCache = new Dictionary <string, string>();
            //BuildClassPath(); // defered to first use
        }
Example #6
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new HaXeSettings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (HaXeSettings)obj;
     }
     if (this.settingObject.HaXePath == null) // default values
     {
         string eVariable = System.Environment.GetEnvironmentVariable("HAXEPATH");
         settingObject.HaXePath = eVariable ?? @"C:\Program Files\Motion-Twin\haxe";
     }
     this.settingObject.OnClasspathChanged += SettingObjectOnClasspathChanged;
 }
Example #7
0
        public Context(HaXeSettings initSettings)
        {
            hxsettings = initSettings;
            hxsettings.Init();

            /* AS-LIKE OPTIONS */

            hasLevels = false;
            docType = "Void"; // "flash.display.MovieClip";

            /* DESCRIBE LANGUAGE FEATURES */

            // language constructs
            features.hasPackages = true;
            features.hasImports = true;
            features.hasImportsWildcard = false;
            features.hasClasses = true;
            features.hasExtends = true;
            features.hasImplements = true;
            features.hasInterfaces = true;
            features.hasEnums = true;
            features.hasTypeDefs = true;
            features.hasGenerics = true;
            features.hasEcmaTyping = true;
            features.hasVars = true;
            features.hasConsts = false;
            features.hasMethods = true;
            features.hasStatics = true;
            features.hasTryCatch = true;
            features.checkFileName = false;

            // haxe directives
            features.hasDirectives = true;
            features.Directives = new List<string>();
            features.Directives.Add("true");

            // allowed declarations access modifiers
            Visibility all = Visibility.Public | Visibility.Private;
            features.classModifiers = all;
            features.varModifiers = all;
            features.methodModifiers = all;

            // default declarations access modifiers
            features.classModifierDefault = Visibility.Public;
            features.enumModifierDefault = Visibility.Public;
            features.typedefModifierDefault = Visibility.Public;
            features.varModifierDefault = Visibility.Private;
            features.methodModifierDefault = Visibility.Private;

            // keywords
            features.dot = ".";
            features.voidKey = "Void";
            features.objectKey = "Dynamic";
            features.importKey = "import";
            features.importKeyAlt = "using";
            features.typesPreKeys = new string[] { "import", "new", "extends", "implements", "using" };
            features.codeKeywords = new string[] { 
                "var", "function", "new", "cast", "return", "break", "continue", "callback",
                "if", "else", "for", "while", "do", "switch", "case", "default", 
                "null", "untyped", "true", "false", "try", "catch", "throw", "inline", "dynamic"
            };
            features.varKey = "var";
            features.overrideKey = "override";
            features.functionKey = "function";
            features.staticKey = "static";
            features.publicKey = "public";
            features.privateKey = "private";
            features.intrinsicKey = "extern";
            features.inlineKey = "inline";

            /* INITIALIZATION */

            settings = initSettings;
            haxelibsCache = new Dictionary<string,string>();
            //BuildClassPath(); // defered to first use
        }