From b10e8084f117d14ceb4251bc3a19a0080a8e808a Mon Sep 17 00:00:00 2001 From: sumneko Date: Mon, 13 May 2019 14:43:37 +0800 Subject: =?UTF-8?q?=E6=8E=92=E9=99=A4=E7=9A=84=E6=96=87=E4=BB=B6=E5=9C=A8?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=96=87=E4=BB=B6=E5=90=8E=E6=B8=85=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/service.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'server/src/service.lua') 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) -- cgit v1.2.3