Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Unsupported TomlTableHeader type #262

Closed
koxudaxi opened this issue Aug 8, 2021 · 1 comment
Closed

Unsupported TomlTableHeader type #262

koxudaxi opened this issue Aug 8, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@koxudaxi
Copy link
Owner

koxudaxi commented Aug 8, 2021

This issue is copied from koxudaxi/pydantic-pycharm-plugin#333
the original issue is created by @chbndrhnns

Describe the bug
Pycharm raises this error

Click to toggle
During querying provider Run line marker (class com.intellij.execution.lineMarker.RunLineMarkerProvider)

java.lang.Exception: unsupported TomlTableHeader type
	at com.koxudaxi.poetry.PoetryKt.getKeyByTomlTableHeader(poetry.kt:749)
	at com.koxudaxi.poetry.PoetryKt.getKeyText(poetry.kt:732)
	at com.koxudaxi.poetry.PoetryExtrasLineMarkerContributor.getInfo(PoetryExtrasLineMarkerContributor.kt:21)
	at com.intellij.execution.lineMarker.RunLineMarkerProvider.getLineMarkerInfo(RunLineMarkerProvider.java:58)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:157)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:90)
	at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:81)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:77)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

To Reproduce

This is the toml file in question (redacted):

Click to toggle
[tool.poetry]
name = "xxx"
version = "1.2.0"
description = "xxx"
authors = ["xxx <xxx>"]
readme = "README.md"
repository = "https://xxx"
documentation = "http://xxx/"
packages = [
    { include = "fastapi_server", from = "src" },
    { include = "shared_core", from = "src" },
    { include = "core_base", from = "src" },
]

[[tool.poetry.source]]
name = 'xxx'
url = 'xxx'

[tool.poetry.dependencies]
asyncstdlib = "^3.9.2"
deprecation = ">=2"
fastapi = { extras = ["all"], version = "^0.66" }
xxx = "^1"
#xxx = { develop = true, path = "../xxx" }
python = "^3.8.6"
toml = "^0.10.2"

# docs extra
mkdocs = { version = "^1.2", optional = true }
livereload = { version = "^2.6.3", optional = true } # remove if mkdocstrings no longer requires it
mkdocs-material = { version = "^7.1.9", optional = true }
mkdocstrings = { version = "^0.15.2", optional = true }
markdown-include = { version = "^0.6", optional = true }
pymdown-extensions = { version = "^8.0.1", optional = true }

# build extra
pre-commit = { version = "^2.13.0", optional = true }
black = { version = "^21.6b0", optional = true }
isort = { version = "^5.9.1", optional = true }
python-semantic-release = { version = "^7.16.1", optional = true }
pylint = { version = "^2.9.3", optional = true }
gitlint = { version = "^0.15.0", optional = true }
starlette-context = "^0.3.3"
passlib = { extras = ["bcrypt"], version = "^1.7.4" }
prometheus-fastapi-instrumentator = "^5.7.1"
mypy = { version = "^0.910", optional = true }
async-property = "^0.2.1"

[tool.poetry.dev-dependencies]
asgi-lifespan = "^1.0.1"
autoflake = "^1.4"
httpx = "~=0.18.2"
coverage = ">=4.0.3"
namesgenerator = "^0.3"
nose = ">=1.3.7"
pluggy = ">=0.3.1"
py = ">=1.4.31"
pytest = "^6.2.3"
pytest-asyncio = "^0.15.1"
pytest-cov = ">=2.10"
pytest-mock = ">=3.3.1"
pytest-sugar = "^0.9.4"
python-jose = "^3.3.0"
randomize = ">=0.13"
respx = "~=0.17.1"

[tool.poetry.extras]
docs = ["livereload", "mkdocs", "mkdocs-material", "mkdocstrings", "markdown-include", "pymdown-extensions"]
build = ["pre-commit", "gitlint", "pylint", "black", "mypy", "isort", "python-semantic-release"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"
multi_line_output = 3

[tool.pylint.MASTER]
ignore = "tests,.venv,migrations,alembic"
jobs = 0
extension-pkg-whitelist = "pydantic"
disable = [
    "arguments-differ",
    "bad-continuation",
    "bad-whitespace",
    "unsubscriptable-object",
    "super-init-not-called",
]
max-line-length = 88
good-names = [
    "db",
    "fn",
    "k",
    "ok",
    "op",
    "v",
    "vm",
    "T"
]

[tool.pylint.MESSAGE_CONTROL]
disable = [
    "too-few-public-methods"
]
enable = [
    "useless-supression"
]

[tool.pylint.SIMILARITIES]
min-similarity-lines = 20
ignore-comments = "no"
ignore-docstrings = "no"
ignore-imports = "yes"


[tool.pylint.DESIGN]
max-parents = 15

[tool.pytest.ini_options]
addopts = "--strict-markers --doctest-modules"
markers = [
    "e2e: e2e tests that require a connection with GitLab",
    "integration: integration tests that have mocked external dependencies"
]

filterwarnings = [
    "ignore::DeprecationWarning"
]

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''\
    /(
        \.git
      | \.hg
      | \.mypy_cache
      | \.tox
      | \.venv
      | _build
      | buck-out
      | build
      | dist
    )/
    '''

[tool.semantic_release]
version_variable = "pyproject.toml:version"
upload_to_pypi = false
commit_subject = "build(core): Bump version to v{version}"
hvcs = "gitlab"
hvcs_domain = "xxx"
upload_to_release = true
build_command = "poetry build"
branch = "master"
commit_author = "semantic-release <xxx>"

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.

Environments (please complete the following information):

  • IDE: PyCharm Pro 2021.1
  • OS: macOS 10.14
  • Pydantic Version: 1.7.4
  • Plugin version: 0.3.4

Additional context
Add any other context about the problem here.

@koxudaxi koxudaxi added the bug Something isn't working label Aug 8, 2021
@caniko
Copy link

caniko commented Aug 23, 2021

I am getting the same error.

Environment
IDE: PyCharm Pro 2021.2
OS: Windows 10
Plugin version: 1.1.4-212

Stacktrace

During querying provider Run line marker (class com.intellij.execution.lineMarker.RunLineMarkerProvider)

java.lang.Exception: unsupported TomlTableHeader type
	at com.koxudaxi.poetry.PoetryKt.getKeyByTomlTableHeader(poetry.kt:749)
	at com.koxudaxi.poetry.PoetryKt.getKeyText(poetry.kt:732)
	at com.koxudaxi.poetry.PoetryExtrasLineMarkerContributor.getInfo(PoetryExtrasLineMarkerContributor.kt:21)
	at com.intellij.execution.lineMarker.RunLineMarkerProvider.getLineMarkerInfo(RunLineMarkerProvider.java:58)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:155)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:82)
	at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:81)
	at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:77)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:399)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1078)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:392)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants