File: module.py

package info (click to toggle)
fortran-language-server 3.2.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,268 kB
  • sloc: python: 9,688; f90: 1,195; fortran: 30; makefile: 28; ansic: 20
file content (21 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import annotations

from fortls.constants import MODULE_TYPE_ID

from .scope import Scope


class Module(Scope):
    def get_type(self, no_link=False):
        return MODULE_TYPE_ID

    def get_desc(self):
        return "MODULE"

    def get_hover(self, long=False, drop_arg=-1) -> tuple[str, str]:
        hover = f"{self.get_desc()} {self.name}"
        doc_str = self.get_documentation()
        return hover, doc_str

    def check_valid_parent(self) -> bool:
        return self.parent is None