We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Diagnostic not highlighted in view when range is empty
**Describe the bug**
A diagnostic that has an empty range is not visible in the view (only in the gutter and in diagnostics panel).

**To Reproduce**
Receive a diagnostic like:
```js
{
  "diagnostics": [
    {
      "code": {
        "target": "https://eslint.org/docs/rules/curly",
        "value": "curly"
      },
      "message": "Expected { after 'if' condition.",
      "range": {
        "end": {
          "character": 9,
          "line": 607
        },
        "start": {
          "character": 9,
          "line": 607
        }
      },
      "severity": 1,
      "source": "eslint"
    },
```

**Expected behavior**
See where on the line the problem is. Otherwise, it's difficult to know where code action can be triggered.

**Screenshots**
![Screenshot 2020-09-25 at 22 58 01](https://user-images.githubusercontent.com/153197/94315521-f6394080-ff82-11ea-9dc6-7adffb643465.png)


**Environment (please complete the following information):**
- OS: macOS
- Sublime Text version: 4087
- LSP version: 49ea7330301078035ad56b94218a9c6edb604498
- Language servers used: eslint

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plugin/session_view.py`
Content:
```
1 from .core.protocol import Diagnostic
2 from .core.protocol import Request
3 from .core.sessions import Session
4 from .core.settings import userprefs
5 from .core.types import view2scope
6 from .core.typing import Any, Iterable, List, Tuple, Optional, Dict
7 from .core.views import DIAGNOSTIC_SEVERITY
8 from .core.windows import AbstractViewListener
9 from .session_buffer import SessionBuffer
10 from weakref import ref
11 from weakref import WeakValueDictionary
12 import sublime
13 
14 
15 class SessionView:
16     """
17     Holds state per session per view.
18     """
19 
20     LANGUAGE_ID_KEY = "lsp_language"
21     SHOW_DEFINITIONS_KEY = "show_definitions"
22     HOVER_PROVIDER_KEY = "hoverProvider"
23     HOVER_PROVIDER_COUNT_KEY = "lsp_hover_provider_count"
24 
25     _session_buffers = WeakValueDictionary()  # type: WeakValueDictionary[Tuple[str, int], SessionBuffer]
26 
27     def __init__(self, listener: AbstractViewListener, session: Session) -> None:
28         self.view = listener.view
29         self.session = session
30         self.active_requests = {}  # type: Dict[int, Request]
31         settings = self.view.settings()
32         # TODO: Language ID must be UNIQUE!
33         languages = settings.get(self.LANGUAGE_ID_KEY)
34         self._language_id = ''
35         if not isinstance(languages, dict):
36             languages = {}
37         for language in session.config.languages:
38             if language.match_scope(view2scope(self.view)):
39                 languages[session.config.name] = language.id
40                 self._language_id = language.id
41                 break
42         settings.set(self.LANGUAGE_ID_KEY, languages)
43         buffer_id = self.view.buffer_id()
44         key = (session.config.name, buffer_id)
45         session_buffer = self._session_buffers.get(key)
46         if session_buffer is None:
47             session_buffer = SessionBuffer(self, buffer_id, self._language_id)
48             self._session_buffers[key] = session_buffer
49         else:
50             session_buffer.add_session_view(self)
51         self.session_buffer = session_buffer
52         self.listener = ref(listener)
53         session.register_session_view_async(self)
54         session.config.set_view_status(self.view, "")
55         if self.session.has_capability(self.HOVER_PROVIDER_KEY):
56             self._increment_hover_count()
57 
58     def __del__(self) -> None:
59         if self.session.has_capability(self.HOVER_PROVIDER_KEY):
60             self._decrement_hover_count()
61         # If the session is exiting then there's no point in sending textDocument/didClose and there's also no point
62         # in unregistering ourselves from the session.
63         if not self.session.exiting:
64             self.session.unregister_session_view_async(self)
65         self.session.config.erase_view_status(self.view)
66         settings = self.view.settings()  # type: sublime.Settings
67         # TODO: Language ID must be UNIQUE!
68         languages = settings.get(self.LANGUAGE_ID_KEY)
69         if isinstance(languages, dict):
70             languages.pop(self.session.config.name, None)
71             if languages:
72                 settings.set(self.LANGUAGE_ID_KEY, languages)
73             else:
74                 settings.erase(self.LANGUAGE_ID_KEY)
75         for severity in range(1, len(DIAGNOSTIC_SEVERITY) + 1):
76             self.view.erase_regions(self.diagnostics_key(severity))
77 
78     def _increment_hover_count(self) -> None:
79         settings = self.view.settings()
80         count = settings.get(self.HOVER_PROVIDER_COUNT_KEY, 0)
81         if isinstance(count, int):
82             count += 1
83             settings.set(self.HOVER_PROVIDER_COUNT_KEY, count)
84             settings.set(self.SHOW_DEFINITIONS_KEY, False)
85 
86     def _decrement_hover_count(self) -> None:
87         settings = self.view.settings()
88         count = settings.get(self.HOVER_PROVIDER_COUNT_KEY)
89         if isinstance(count, int):
90             count -= 1
91             if count == 0:
92                 settings.erase(self.HOVER_PROVIDER_COUNT_KEY)
93                 settings.set(self.SHOW_DEFINITIONS_KEY, True)
94 
95     def get_capability(self, capability_path: str) -> Optional[Any]:
96         return self.session_buffer.get_capability(capability_path)
97 
98     def has_capability(self, capability_path: str) -> bool:
99         value = self.session_buffer.get_capability(capability_path)
100         return isinstance(value, dict) or bool(value)
101 
102     def on_capability_added_async(self, capability_path: str, options: Dict[str, Any]) -> None:
103         if capability_path == self.HOVER_PROVIDER_KEY:
104             self._increment_hover_count()
105 
106     def on_capability_removed_async(self, discarded: Dict[str, Any]) -> None:
107         if self.HOVER_PROVIDER_KEY in discarded:
108             self._decrement_hover_count()
109 
110     def has_capability_async(self, capability_path: str) -> bool:
111         return self.session_buffer.has_capability(capability_path)
112 
113     def shutdown_async(self) -> None:
114         listener = self.listener()
115         if listener:
116             listener.on_session_shutdown_async(self.session)
117 
118     def diagnostics_key(self, severity: int) -> str:
119         return "lsp{}d{}".format(self.session.config.name, severity)
120 
121     def present_diagnostics_async(self, flags: int) -> None:
122         data_per_severity = self.session_buffer.data_per_severity
123         for severity in reversed(range(1, len(DIAGNOSTIC_SEVERITY) + 1)):
124             key = self.diagnostics_key(severity)
125             data = data_per_severity.get(severity)
126             if data is None:
127                 self.view.erase_regions(key)
128             elif ((severity <= userprefs().show_diagnostics_severity_level) and
129                     (data.icon or flags != (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE))):
130                 self.view.add_regions(key, data.regions, data.scope, data.icon, flags)
131             else:
132                 self.view.erase_regions(key)
133         listener = self.listener()
134         if listener:
135             listener.on_diagnostics_updated_async()
136 
137     def get_diagnostics_async(self) -> List[Diagnostic]:
138         return self.session_buffer.diagnostics
139 
140     def on_request_started_async(self, request_id: int, request: Request) -> None:
141         self.active_requests[request_id] = request
142 
143     def on_request_finished_async(self, request_id: int) -> None:
144         self.active_requests.pop(request_id, None)
145 
146     def on_text_changed_async(self, changes: Iterable[sublime.TextChange]) -> None:
147         self.session_buffer.on_text_changed_async(self.view, changes)
148 
149     def on_revert_async(self) -> None:
150         self.session_buffer.on_revert_async(self.view)
151 
152     def on_reload_async(self) -> None:
153         self.session_buffer.on_reload_async(self.view)
154 
155     def purge_changes_async(self) -> None:
156         self.session_buffer.purge_changes_async(self.view)
157 
158     def on_pre_save_async(self, old_file_name: str) -> None:
159         self.session_buffer.on_pre_save_async(self.view, old_file_name)
160 
161     def on_post_save_async(self) -> None:
162         self.session_buffer.on_post_save_async(self.view)
163 
164     def __str__(self) -> str:
165         return '{}:{}'.format(self.session.config.name, self.view.id())
166
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/plugin/session_view.py b/plugin/session_view.py
--- a/plugin/session_view.py
+++ b/plugin/session_view.py
@@ -127,7 +127,15 @@
                 self.view.erase_regions(key)
             elif ((severity <= userprefs().show_diagnostics_severity_level) and
                     (data.icon or flags != (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE))):
-                self.view.add_regions(key, data.regions, data.scope, data.icon, flags)
+
+                def handle_same_regions(region: sublime.Region) -> sublime.Region:
+                    # this allows showing diagnostics with same begin and end in the view
+                    if region.a == region.b:
+                        return sublime.Region(region.a, region.a + 1)
+                    return region
+
+                underline_regions = list(map(handle_same_regions, data.regions))
+                self.view.add_regions(key, underline_regions, data.scope, data.icon, flags)
             else:
                 self.view.erase_regions(key)
         listener = self.listener()

{"golden_diff": "diff --git a/plugin/session_view.py b/plugin/session_view.py\n--- a/plugin/session_view.py\n+++ b/plugin/session_view.py\n@@ -127,7 +127,15 @@\n                 self.view.erase_regions(key)\n             elif ((severity <= userprefs().show_diagnostics_severity_level) and\n                     (data.icon or flags != (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE))):\n-                self.view.add_regions(key, data.regions, data.scope, data.icon, flags)\n+\n+                def handle_same_regions(region: sublime.Region) -> sublime.Region:\n+                    # this allows showing diagnostics with same begin and end in the view\n+                    if region.a == region.b:\n+                        return sublime.Region(region.a, region.a + 1)\n+                    return region\n+\n+                underline_regions = list(map(handle_same_regions, data.regions))\n+                self.view.add_regions(key, underline_regions, data.scope, data.icon, flags)\n             else:\n                 self.view.erase_regions(key)\n         listener = self.listener()\n", "issue": "Diagnostic not highlighted in view when range is empty\n**Describe the bug**\r\nA diagnostic that has an empty range is not visible in the view (only in the gutter and in diagnostics panel).\r\n\r\n**To Reproduce**\r\nReceive a diagnostic like:\r\n```js\r\n{\r\n  \"diagnostics\": [\r\n    {\r\n      \"code\": {\r\n        \"target\": \"https://eslint.org/docs/rules/curly\",\r\n        \"value\": \"curly\"\r\n      },\r\n      \"message\": \"Expected { after 'if' condition.\",\r\n      \"range\": {\r\n        \"end\": {\r\n          \"character\": 9,\r\n          \"line\": 607\r\n        },\r\n        \"start\": {\r\n          \"character\": 9,\r\n          \"line\": 607\r\n        }\r\n      },\r\n      \"severity\": 1,\r\n      \"source\": \"eslint\"\r\n    },\r\n```\r\n\r\n**Expected behavior**\r\nSee where on the line the problem is. Otherwise, it's difficult to know where code action can be triggered.\r\n\r\n**Screenshots**\r\n![Screenshot 2020-09-25 at 22 58 01](https://user-images.githubusercontent.com/153197/94315521-f6394080-ff82-11ea-9dc6-7adffb643465.png)\r\n\r\n\r\n**Environment (please complete the following information):**\r\n- OS: macOS\r\n- Sublime Text version: 4087\r\n- LSP version: 49ea7330301078035ad56b94218a9c6edb604498\r\n- Language servers used: eslint\n", "before_files": [{"content": "from .core.protocol import Diagnostic\nfrom .core.protocol import Request\nfrom .core.sessions import Session\nfrom .core.settings import userprefs\nfrom .core.types import view2scope\nfrom .core.typing import Any, Iterable, List, Tuple, Optional, Dict\nfrom .core.views import DIAGNOSTIC_SEVERITY\nfrom .core.windows import AbstractViewListener\nfrom .session_buffer import SessionBuffer\nfrom weakref import ref\nfrom weakref import WeakValueDictionary\nimport sublime\n\n\nclass SessionView:\n    \"\"\"\n    Holds state per session per view.\n    \"\"\"\n\n    LANGUAGE_ID_KEY = \"lsp_language\"\n    SHOW_DEFINITIONS_KEY = \"show_definitions\"\n    HOVER_PROVIDER_KEY = \"hoverProvider\"\n    HOVER_PROVIDER_COUNT_KEY = \"lsp_hover_provider_count\"\n\n    _session_buffers = WeakValueDictionary()  # type: WeakValueDictionary[Tuple[str, int], SessionBuffer]\n\n    def __init__(self, listener: AbstractViewListener, session: Session) -> None:\n        self.view = listener.view\n        self.session = session\n        self.active_requests = {}  # type: Dict[int, Request]\n        settings = self.view.settings()\n        # TODO: Language ID must be UNIQUE!\n        languages = settings.get(self.LANGUAGE_ID_KEY)\n        self._language_id = ''\n        if not isinstance(languages, dict):\n            languages = {}\n        for language in session.config.languages:\n            if language.match_scope(view2scope(self.view)):\n                languages[session.config.name] = language.id\n                self._language_id = language.id\n                break\n        settings.set(self.LANGUAGE_ID_KEY, languages)\n        buffer_id = self.view.buffer_id()\n        key = (session.config.name, buffer_id)\n        session_buffer = self._session_buffers.get(key)\n        if session_buffer is None:\n            session_buffer = SessionBuffer(self, buffer_id, self._language_id)\n            self._session_buffers[key] = session_buffer\n        else:\n            session_buffer.add_session_view(self)\n        self.session_buffer = session_buffer\n        self.listener = ref(listener)\n        session.register_session_view_async(self)\n        session.config.set_view_status(self.view, \"\")\n        if self.session.has_capability(self.HOVER_PROVIDER_KEY):\n            self._increment_hover_count()\n\n    def __del__(self) -> None:\n        if self.session.has_capability(self.HOVER_PROVIDER_KEY):\n            self._decrement_hover_count()\n        # If the session is exiting then there's no point in sending textDocument/didClose and there's also no point\n        # in unregistering ourselves from the session.\n        if not self.session.exiting:\n            self.session.unregister_session_view_async(self)\n        self.session.config.erase_view_status(self.view)\n        settings = self.view.settings()  # type: sublime.Settings\n        # TODO: Language ID must be UNIQUE!\n        languages = settings.get(self.LANGUAGE_ID_KEY)\n        if isinstance(languages, dict):\n            languages.pop(self.session.config.name, None)\n            if languages:\n                settings.set(self.LANGUAGE_ID_KEY, languages)\n            else:\n                settings.erase(self.LANGUAGE_ID_KEY)\n        for severity in range(1, len(DIAGNOSTIC_SEVERITY) + 1):\n            self.view.erase_regions(self.diagnostics_key(severity))\n\n    def _increment_hover_count(self) -> None:\n        settings = self.view.settings()\n        count = settings.get(self.HOVER_PROVIDER_COUNT_KEY, 0)\n        if isinstance(count, int):\n            count += 1\n            settings.set(self.HOVER_PROVIDER_COUNT_KEY, count)\n            settings.set(self.SHOW_DEFINITIONS_KEY, False)\n\n    def _decrement_hover_count(self) -> None:\n        settings = self.view.settings()\n        count = settings.get(self.HOVER_PROVIDER_COUNT_KEY)\n        if isinstance(count, int):\n            count -= 1\n            if count == 0:\n                settings.erase(self.HOVER_PROVIDER_COUNT_KEY)\n                settings.set(self.SHOW_DEFINITIONS_KEY, True)\n\n    def get_capability(self, capability_path: str) -> Optional[Any]:\n        return self.session_buffer.get_capability(capability_path)\n\n    def has_capability(self, capability_path: str) -> bool:\n        value = self.session_buffer.get_capability(capability_path)\n        return isinstance(value, dict) or bool(value)\n\n    def on_capability_added_async(self, capability_path: str, options: Dict[str, Any]) -> None:\n        if capability_path == self.HOVER_PROVIDER_KEY:\n            self._increment_hover_count()\n\n    def on_capability_removed_async(self, discarded: Dict[str, Any]) -> None:\n        if self.HOVER_PROVIDER_KEY in discarded:\n            self._decrement_hover_count()\n\n    def has_capability_async(self, capability_path: str) -> bool:\n        return self.session_buffer.has_capability(capability_path)\n\n    def shutdown_async(self) -> None:\n        listener = self.listener()\n        if listener:\n            listener.on_session_shutdown_async(self.session)\n\n    def diagnostics_key(self, severity: int) -> str:\n        return \"lsp{}d{}\".format(self.session.config.name, severity)\n\n    def present_diagnostics_async(self, flags: int) -> None:\n        data_per_severity = self.session_buffer.data_per_severity\n        for severity in reversed(range(1, len(DIAGNOSTIC_SEVERITY) + 1)):\n            key = self.diagnostics_key(severity)\n            data = data_per_severity.get(severity)\n            if data is None:\n                self.view.erase_regions(key)\n            elif ((severity <= userprefs().show_diagnostics_severity_level) and\n                    (data.icon or flags != (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE))):\n                self.view.add_regions(key, data.regions, data.scope, data.icon, flags)\n            else:\n                self.view.erase_regions(key)\n        listener = self.listener()\n        if listener:\n            listener.on_diagnostics_updated_async()\n\n    def get_diagnostics_async(self) -> List[Diagnostic]:\n        return self.session_buffer.diagnostics\n\n    def on_request_started_async(self, request_id: int, request: Request) -> None:\n        self.active_requests[request_id] = request\n\n    def on_request_finished_async(self, request_id: int) -> None:\n        self.active_requests.pop(request_id, None)\n\n    def on_text_changed_async(self, changes: Iterable[sublime.TextChange]) -> None:\n        self.session_buffer.on_text_changed_async(self.view, changes)\n\n    def on_revert_async(self) -> None:\n        self.session_buffer.on_revert_async(self.view)\n\n    def on_reload_async(self) -> None:\n        self.session_buffer.on_reload_async(self.view)\n\n    def purge_changes_async(self) -> None:\n        self.session_buffer.purge_changes_async(self.view)\n\n    def on_pre_save_async(self, old_file_name: str) -> None:\n        self.session_buffer.on_pre_save_async(self.view, old_file_name)\n\n    def on_post_save_async(self) -> None:\n        self.session_buffer.on_post_save_async(self.view)\n\n    def __str__(self) -> str:\n        return '{}:{}'.format(self.session.config.name, self.view.id())\n", "path": "plugin/session_view.py"}], "after_files": [{"content": "from .core.protocol import Diagnostic\nfrom .core.protocol import Request\nfrom .core.sessions import Session\nfrom .core.settings import userprefs\nfrom .core.types import view2scope\nfrom .core.typing import Any, Iterable, List, Tuple, Optional, Dict\nfrom .core.views import DIAGNOSTIC_SEVERITY\nfrom .core.windows import AbstractViewListener\nfrom .session_buffer import SessionBuffer\nfrom weakref import ref\nfrom weakref import WeakValueDictionary\nimport sublime\n\n\nclass SessionView:\n    \"\"\"\n    Holds state per session per view.\n    \"\"\"\n\n    LANGUAGE_ID_KEY = \"lsp_language\"\n    SHOW_DEFINITIONS_KEY = \"show_definitions\"\n    HOVER_PROVIDER_KEY = \"hoverProvider\"\n    HOVER_PROVIDER_COUNT_KEY = \"lsp_hover_provider_count\"\n\n    _session_buffers = WeakValueDictionary()  # type: WeakValueDictionary[Tuple[str, int], SessionBuffer]\n\n    def __init__(self, listener: AbstractViewListener, session: Session) -> None:\n        self.view = listener.view\n        self.session = session\n        self.active_requests = {}  # type: Dict[int, Request]\n        settings = self.view.settings()\n        # TODO: Language ID must be UNIQUE!\n        languages = settings.get(self.LANGUAGE_ID_KEY)\n        self._language_id = ''\n        if not isinstance(languages, dict):\n            languages = {}\n        for language in session.config.languages:\n            if language.match_scope(view2scope(self.view)):\n                languages[session.config.name] = language.id\n                self._language_id = language.id\n                break\n        settings.set(self.LANGUAGE_ID_KEY, languages)\n        buffer_id = self.view.buffer_id()\n        key = (session.config.name, buffer_id)\n        session_buffer = self._session_buffers.get(key)\n        if session_buffer is None:\n            session_buffer = SessionBuffer(self, buffer_id, self._language_id)\n            self._session_buffers[key] = session_buffer\n        else:\n            session_buffer.add_session_view(self)\n        self.session_buffer = session_buffer\n        self.listener = ref(listener)\n        session.register_session_view_async(self)\n        session.config.set_view_status(self.view, \"\")\n        if self.session.has_capability(self.HOVER_PROVIDER_KEY):\n            self._increment_hover_count()\n\n    def __del__(self) -> None:\n        if self.session.has_capability(self.HOVER_PROVIDER_KEY):\n            self._decrement_hover_count()\n        # If the session is exiting then there's no point in sending textDocument/didClose and there's also no point\n        # in unregistering ourselves from the session.\n        if not self.session.exiting:\n            self.session.unregister_session_view_async(self)\n        self.session.config.erase_view_status(self.view)\n        settings = self.view.settings()  # type: sublime.Settings\n        # TODO: Language ID must be UNIQUE!\n        languages = settings.get(self.LANGUAGE_ID_KEY)\n        if isinstance(languages, dict):\n            languages.pop(self.session.config.name, None)\n            if languages:\n                settings.set(self.LANGUAGE_ID_KEY, languages)\n            else:\n                settings.erase(self.LANGUAGE_ID_KEY)\n        for severity in range(1, len(DIAGNOSTIC_SEVERITY) + 1):\n            self.view.erase_regions(self.diagnostics_key(severity))\n\n    def _increment_hover_count(self) -> None:\n        settings = self.view.settings()\n        count = settings.get(self.HOVER_PROVIDER_COUNT_KEY, 0)\n        if isinstance(count, int):\n            count += 1\n            settings.set(self.HOVER_PROVIDER_COUNT_KEY, count)\n            settings.set(self.SHOW_DEFINITIONS_KEY, False)\n\n    def _decrement_hover_count(self) -> None:\n        settings = self.view.settings()\n        count = settings.get(self.HOVER_PROVIDER_COUNT_KEY)\n        if isinstance(count, int):\n            count -= 1\n            if count == 0:\n                settings.erase(self.HOVER_PROVIDER_COUNT_KEY)\n                settings.set(self.SHOW_DEFINITIONS_KEY, True)\n\n    def get_capability(self, capability_path: str) -> Optional[Any]:\n        return self.session_buffer.get_capability(capability_path)\n\n    def has_capability(self, capability_path: str) -> bool:\n        value = self.session_buffer.get_capability(capability_path)\n        return isinstance(value, dict) or bool(value)\n\n    def on_capability_added_async(self, capability_path: str, options: Dict[str, Any]) -> None:\n        if capability_path == self.HOVER_PROVIDER_KEY:\n            self._increment_hover_count()\n\n    def on_capability_removed_async(self, discarded: Dict[str, Any]) -> None:\n        if self.HOVER_PROVIDER_KEY in discarded:\n            self._decrement_hover_count()\n\n    def has_capability_async(self, capability_path: str) -> bool:\n        return self.session_buffer.has_capability(capability_path)\n\n    def shutdown_async(self) -> None:\n        listener = self.listener()\n        if listener:\n            listener.on_session_shutdown_async(self.session)\n\n    def diagnostics_key(self, severity: int) -> str:\n        return \"lsp{}d{}\".format(self.session.config.name, severity)\n\n    def present_diagnostics_async(self, flags: int) -> None:\n        data_per_severity = self.session_buffer.data_per_severity\n        for severity in reversed(range(1, len(DIAGNOSTIC_SEVERITY) + 1)):\n            key = self.diagnostics_key(severity)\n            data = data_per_severity.get(severity)\n            if data is None:\n                self.view.erase_regions(key)\n            elif ((severity <= userprefs().show_diagnostics_severity_level) and\n                    (data.icon or flags != (sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE))):\n\n                def handle_same_regions(region: sublime.Region) -> sublime.Region:\n                    # this allows showing diagnostics with same begin and end in the view\n                    if region.a == region.b:\n                        return sublime.Region(region.a, region.a + 1)\n                    return region\n\n                underline_regions = list(map(handle_same_regions, data.regions))\n                self.view.add_regions(key, underline_regions, data.scope, data.icon, flags)\n            else:\n                self.view.erase_regions(key)\n        listener = self.listener()\n        if listener:\n            listener.on_diagnostics_updated_async()\n\n    def get_diagnostics_async(self) -> List[Diagnostic]:\n        return self.session_buffer.diagnostics\n\n    def on_request_started_async(self, request_id: int, request: Request) -> None:\n        self.active_requests[request_id] = request\n\n    def on_request_finished_async(self, request_id: int) -> None:\n        self.active_requests.pop(request_id, None)\n\n    def on_text_changed_async(self, changes: Iterable[sublime.TextChange]) -> None:\n        self.session_buffer.on_text_changed_async(self.view, changes)\n\n    def on_revert_async(self) -> None:\n        self.session_buffer.on_revert_async(self.view)\n\n    def on_reload_async(self) -> None:\n        self.session_buffer.on_reload_async(self.view)\n\n    def purge_changes_async(self) -> None:\n        self.session_buffer.purge_changes_async(self.view)\n\n    def on_pre_save_async(self, old_file_name: str) -> None:\n        self.session_buffer.on_pre_save_async(self.view, old_file_name)\n\n    def on_post_save_async(self) -> None:\n        self.session_buffer.on_post_save_async(self.view)\n\n    def __str__(self) -> str:\n        return '{}:{}'.format(self.session.config.name, self.view.id())\n", "path": "plugin/session_view.py"}]}