119 """ |
119 """ |
120 if self.__plugin.getPreferences("AutoCompletionEnabled"): |
120 if self.__plugin.getPreferences("AutoCompletionEnabled"): |
121 self.__setAutoCompletionHook(editor) |
121 self.__setAutoCompletionHook(editor) |
122 if self.__plugin.getPreferences("CalltipsEnabled"): |
122 if self.__plugin.getPreferences("CalltipsEnabled"): |
123 self.__setCalltipsHook(editor) |
123 self.__setCalltipsHook(editor) |
124 editor.editorSaved.connect( |
124 if (api := self.__apisManager.getAPIs(ApisNameProject)) is not None: |
125 self.__apisManager.getAPIs(ApisNameProject).editorSaved |
125 editor.editorSaved.connect(api.editorSaved) |
126 ) |
|
127 self.__editors.append(editor) |
126 self.__editors.append(editor) |
128 |
127 |
129 # preload the api to give the manager a chance to prepare the database |
128 # preload the api to give the manager a chance to prepare the database |
130 language = editor.getApiLanguage() |
129 language = editor.getApiLanguage() |
131 if language: |
130 if language: |
138 |
137 |
139 @param editor reference to the editor |
138 @param editor reference to the editor |
140 @type Editor |
139 @type Editor |
141 """ |
140 """ |
142 if editor in self.__editors: |
141 if editor in self.__editors: |
143 editor.editorSaved.disconnect( |
142 if (api := self.__apisManager.getAPIs(ApisNameProject)) is not None: |
144 self.__apisManager.getAPIs(ApisNameProject).editorSaved |
143 editor.editorSaved.disconnect(api.editorSaved) |
145 ) |
|
146 self.__editors.remove(editor) |
144 self.__editors.remove(editor) |
147 if editor.getCompletionListHook("Assistant"): |
145 if editor.getCompletionListHook("Assistant"): |
148 self.__unsetAutoCompletionHook(editor) |
146 self.__unsetAutoCompletionHook(editor) |
149 if editor.getCallTipHook("Assistant"): |
147 if editor.getCallTipHook("Assistant"): |
150 self.__unsetCalltipsHook(editor) |
148 self.__unsetCalltipsHook(editor) |