summaryrefslogtreecommitdiff
path: root/server/src/service.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/service.lua')
-rw-r--r--server/src/service.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 94669218..1e97cb5c 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -184,6 +184,15 @@ function mt:isDeadText(uri)
end
function mt:open(uri, version, text)
+ if self.workspace then
+ local fileName = self.workspace:uriDecode(uri)
+ if not self.workspace:isLuaFile(fileName) then
+ return
+ end
+ if self.workspace.gitignore(fileName:string()) then
+ log.debug('Open ignored file:', fileName:string())
+ end
+ end
self:saveText(uri, version, text)
local obj = self._file[uri]
if obj then
@@ -196,6 +205,17 @@ function mt:close(uri)
if obj then
obj._openByClient = false
end
+ if self.workspace then
+ local fileName = self.workspace:uriDecode(uri)
+ if not self.workspace:isLuaFile(fileName) then
+ self:removeText(uri)
+ return
+ end
+ if self.workspace.gitignore(fileName:string()) then
+ log.debug('Close ignored file:', fileName:string())
+ self:removeText(uri)
+ end
+ end
end
function mt:isOpen(uri)