diff options
author | 2011-02-17 19:27:32 -0500 | |
---|---|---|
committer | 2011-02-17 19:27:32 -0500 | |
commit | ee776fecd97fbfbca7446aa526df8065299a582d (patch) | |
tree | 747fed07444c921283c2d052b6d058dd4fd362f9 /modules/lua/adeptsense.lua | |
parent | 3313d67e8663acac92be9d2526dad1553ad892de (diff) | |
download | textadept-ee776fecd97fbfbca7446aa526df8065299a582d.tar.gz textadept-ee776fecd97fbfbca7446aa526df8065299a582d.zip |
Support type-inference through variable assignment.
Diffstat (limited to 'modules/lua/adeptsense.lua')
-rw-r--r-- | modules/lua/adeptsense.lua | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/modules/lua/adeptsense.lua b/modules/lua/adeptsense.lua index 0d651bcc..47218e61 100644 --- a/modules/lua/adeptsense.lua +++ b/modules/lua/adeptsense.lua @@ -9,20 +9,16 @@ module('_m.lua.adeptsense', package.seeall) sense = _m.textadept.adeptsense.new('lua')
sense.syntax.class_definition = 'module%s*%(?%s*[\'"]([%w_%.]+)'
sense.syntax.symbol_chars = '[%w_%.:]'
+sense.syntax.type_declarations = {}
+sense.syntax.type_assignments = {
+ ["^'"] = 'string', -- foo = 'bar'
+ ['^"'] = 'string', -- foo = "bar"
+ ['^([%w_%.]+)'] = '%1' -- foo = _m.textadept.adeptsense
+}
sense.api_files = { _HOME..'/modules/lua/api' }
sense:add_trigger('.')
sense:add_trigger(':', false, true)
----
--- Returns the current module's name (if any) for showing module completions in
--- addition to global completions. Otherwise returns nil so only global
--- completions are shown.
--- @param symbol Must be the empty string ('').
-function sense:get_class(symbol)
- if symbol ~= '' then return nil end -- no such thing
- return self.super.get_class(self, symbol) -- try to get current module
-end
-
-- script/update_doc generates a fake set of ctags used for autocompletion.
sense.ctags_kinds = {
f = 'functions',
|