MCPcopy
hub / github.com/python/mypy / trigger

Method trigger

mypy/server/update.py:307–325  ·  view source on GitHub ↗

Trigger a specific target explicitly. This is intended for use by the suggestions engine.

(self, target: str)

Source from the content-addressed store, hash-verified

305 return messages
306
307 def trigger(self, target: str) -> list[str]:
308 """Trigger a specific target explicitly.
309
310 This is intended for use by the suggestions engine.
311 """
312 self.manager.errors.reset()
313 changed_modules = propagate_changes_using_dependencies(
314 self.manager,
315 self.graph,
316 self.deps,
317 set(),
318 set(),
319 self.previous_targets_with_errors | {target},
320 [],
321 )
322 # Preserve state needed for the next update.
323 self.previous_targets_with_errors = self.manager.errors.targets()
324 self.previous_messages = self.manager.errors.new_messages().copy()
325 return self.update(changed_modules, [])
326
327 def flush_cache(self) -> None:
328 """Flush AST cache.

Callers 1

try_typeMethod · 0.80

Calls 7

updateMethod · 0.95
setClass · 0.85
resetMethod · 0.45
targetsMethod · 0.45
copyMethod · 0.45
new_messagesMethod · 0.45

Tested by

no test coverage detected