atom-community / atom-ide-datatip Goto Github PK
View Code? Open in Web Editor NEWDatatips for Atom IDE
Home Page: https://atom.io/packages/atom-ide-datatip
License: Other
Datatips for Atom IDE
Home Page: https://atom.io/packages/atom-ide-datatip
License: Other
The default of 500px is pretty limiting
Related #101
Since both packages atom-ide-datatip
and atom-ide-signature-help
are using the same LESS styles we are currently facing some issues:
Here is a list of possible solutions:
atom-ide-markdown-service
package.atom-ide-signature-help
a dependency of atom-ide-datatip
or vice versa.I want to show data tip only when I need to, not when I am moving my cursor/mouse around. So I unchecked both in settings:
And I knew I'll need to press ctrl-alt to toggle on the data tip. This indeed works: when I don't see any data tip and I want to show it, I put my cursor over the word and press ctrl-alt, and the data tip shows up.
However, toggling the data tip off doesn't work. I press ctrl-alt again either immediately after, or after putting my cursor at an empty line. After that, whenever I hover my mouse over something, the data tip still shows up.
The only workaround I found is to open/switch to a new editor window with either an empty document or a different document, then return to the current editor window. At this moment the data tip will not show, regardless if I have tried to toggle it off using ctrl-alt or not.
Opening/switching to a different type of window e.g. Settings, REPL, Workspace, Documentation, does not seem to work.
Version info:
Version: 1.42.0
Dev Mode: false
Official Release: true
{
"http_parser": "2.8.0",
"node": "10.11.0",
"v8": "6.9.427.31-electron.0",
"uv": "1.23.0",
"zlib": "1.2.11",
"ares": "1.14.0",
"modules": "69",
"nghttp2": "1.33.0",
"napi": "3",
"openssl": "1.1.0",
"electron": "4.2.7",
"chrome": "69.0.3497.128",
"icu": "62.2",
"unicode": "11.0",
"cldr": "33.1",
"tz": "2019a"
}
Version: 0.11.3
Config:
{
"consoleOptions": {
"cursorBlink": true
},
"firstBoot": false,
"juliaOptions": {
"deprecationWarnings": false,
"numberOfThreads": "global",
"optimisationLevel": 0
},
"remoteOptions": {
"remoteJulia": "/cygdrive/c/julia-1.3.0/bin/julia.exe"
},
"uiOptions": {
"enableMenu": true,
"errorNotifications": false,
"layouts": {
"console": {
"defaultLocation": "right"
},
"defaultPanes": {
"plotPane": false
},
"documentation": {
"defaultLocation": "right",
"split": "no split"
},
"linter": {
"defaultLocation": "right"
},
"plotPane": {
"defaultLocation": "right",
"split": "no split"
},
"profiler": {
"defaultLocation": "right",
"split": "no split"
},
"terminal": {
"defaultLocation": "right"
},
"workspace": {
"defaultLocation": "right",
"split": "no split"
}
},
"usePlotPane": false
}
}
Version: 0.11.7
Config:
undefined
Version: 0.3.0
Config:
{
"disable": true
}
Version: 0.19.2
Config:
undefined
Version: 0.4.0
Config:
undefined
Version: 0.3.6
Config:
undefined
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = "C:\Users\zpan\AppData\Local\atom\app-1.42.0\atom.exe" -a
JULIA_NUM_THREADS = 4
Status `C:\Users\zpan\.julia\environments\v1.3\Project.toml`
[537997a7] AbstractPlotting v0.9.16
[b19378d9] ArrayFire v1.0.1
[c52e3926] Atom v0.11.3 #master (https://github.com/JunoLab/Atom.jl.git)
[6e4b80f9] BenchmarkTools v0.4.3
[ad839575] Blink v0.12.1
[336ed68f] CSV v0.5.21
[c5f51814] CUDAdrv v5.0.1
[be33ccc6] CUDAnative v2.7.0
[49dc2e85] Calculus v0.5.1
[aaaa29a8] Clustering v0.13.3
[a8cc5b0e] Crayons v4.0.1
[3a865a2d] CuArrays v1.6.0
[717857b8] DSP v0.6.0
[a93c6f00] DataFrames v0.20.0
[864edb3b] DataStructures v0.17.6
[31a5f54b] Debugger v0.6.2
[7806a523] DecisionTree v0.10.0
[0c46a032] DifferentialEquations v6.9.0
[b4f34e82] Distances v0.8.2
[31c24e10] Distributions v0.21.11
[ffa9a821] DocumentFormat v1.1.1
[7a1cc6ca] FFTW v0.3.0
[59287772] Formatting v0.4.1
[38e38edf] GLM v1.3.5
[e9467ef8] GLMakie v0.0.12
[28b8d3ca] GR v0.44.0
[0337cf30] GRUtils v0.4.4
[c91e804a] Gadfly v1.0.1
[c43c736e] Genie v0.22.9
[4c0ca9eb] Gtk v1.1.1
[f67ccb44] HDF5 v0.12.5
[cd3eb016] HTTP v0.8.8
[09f84164] HypothesisTests v0.8.0
[6a3955dd] ImageFiltering v0.6.9
[6deec6e2] IndexedTables v0.12.4
[70c4c096] Indicators v0.7.0
[5903a43b] Infiltrator v0.2.0
[d0351b0e] InspectDR v0.3.6
[c601a237] Interact v0.10.3
[a98d9a8b] Interpolations v0.12.5
[6042db11] JDBC v0.5.0
[4138dd39] JLD v0.9.1
[033835bb] JLD2 v0.1.10
[682c06a0] JSON v0.21.0
[494afd89] JavaCall v0.7.2
[a93385a2] JuliaDB v0.13.0
[aa1ae85d] JuliaInterpreter v0.7.7
[480116ec] JuliaWebAPI v0.6.1
[e5e0dc1b] Juno v0.7.2
[1902f260] Knet v1.2.7
[b964fa9f] LaTeXStrings v1.0.3
[2b0e0bc5] LanguageServer v1.0.0
[fc18253b] LazyJSON v0.2.0
[093fc24a] LightGraphs v1.3.0
[9c8b4983] LightXML v0.8.1
[10e44e05] MATLAB v0.7.3
[ee78f7c6] Makie v0.9.5
[e7bfaba1] NumericalIntegration v0.2.0
[09606e27] ODEInterfaceDiffEq v3.5.0
[47be7bcc] ORCA v0.3.1
[429524aa] Optim v0.19.7
[3b7a836e] PGFPlots v3.2.0
[9b87118b] PackageCompiler v0.6.4
[d96e819e] Parameters v0.12.0
[58dd65bb] Plotly v0.2.0
[f0f68f2c] PlotlyJS v0.13.0
[91a5bcdd] Plots v0.28.4
[f27b6e38] Polynomials v0.6.0
[c46f51b8] ProfileView v0.5.2
[438e738f] PyCall v1.91.2
[d330b81b] PyPlot v2.8.2
[6f49c342] RCall v0.13.4
[295af30f] Revise v2.5.0
[f2b01f46] Roots v0.8.4
[276daf66] SpecialFunctions v0.8.0
[2913bbd2] StatsBase v0.32.0
[054b7d4e] Strategems v0.2.0
[fd094767] Suppressor v0.1.1
[cf896787] SymbolServer v1.0.1
[40c74d1a] TableView v0.4.1
[a110ec8f] Temporal v0.7.0
[b8865327] UnicodePlots v1.1.0
[0f1e0344] WebIO v0.8.13
[fdbf4ff8] XLSX v0.5.8
[6310b701] Yeppp v0.4.0
[a5390f91] ZipFile v0.9.0
[37e2e46d] LinearAlgebra
[6462fe0b] Sockets
[10745b16] Statistics
Do we really need to use domPurify.sanitize
?
Current code uses ReactDOMServer.renderToStaticMarkup
to convert etch.dom()
return to string and then assign it to the innerHTML. This isn't the best approach for rendering these. We should either use etch or React. Loading both packages degrades the performance.
Neither signature-help
or datatip
is working since the latest updates. I'm getting the following error in version 0.7.1:
TypeError: Cannot read property 'addProvider' of null
at DatatipManager.addProvider (/Users/username/.atom/packages/atom-ide-datatip/lib/datatip-manager.js:154:34)
at TypeScriptLanguageClient.consumeDatatip (/Users/username/.atom/packages/ide-typescript/node_modules/atom-languageclient/build/lib/auto-languageclient.js:499:38)
at Provider.t.exports.Provider.provide (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:14:1030585)
at ServiceHub.t.exports.ServiceHub.consume (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2933452)
at Package.activateServices (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2941584)
at Package.activateNow (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2938418)
at measure (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2937742)
at Package.measure (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2935373)
at activationPromise.activationPromise.Promise (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2937602)
at new Promise (<anonymous>)
at Package.activate (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:2937545)
at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382643)
at config.transactAsync (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382259)
at Config.transactAsync (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:332443)
at PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:382209)
at PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:381827)
at t.loadState.then (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:1:686034)
at <anonymous>
The error was thrown from the ide-typescript package. This issue has already been reported.
Atom: 1.35.1
atom-ide-datatip 0.7.1
atom-ide-definitions 0.2.0
atom-ide-signature-help 0.3.1
Tried to install the new markdown package manually but that didn't seem to solve the issue. I'm getting this error every time I open up a new Atom window:
I'm actually experiencing the same issue as #54, but am running the most recent version of this library (0.23.2). I have:
Here is a video, starting with a new buffer of Python code (the workaround described in #54). I start out getting no datatips on hovering, but after typing cmd+alt, they appear when I mouse-hover:
Currently, the datatips use the font size of the editor. This is undesirable for people (me) who prefer large font sizes for the editor but don't mind smaller font sizes for the datatips for space efficiency.
The datatips also use the font family of the editor, which make the documentation strings written in prose look weird and hard to distinguish from code.
I propose setting the default font family for the main datatip text (system-ui
, which is what Atom uses as its variable-width font) and use a percentage for the font size (since the datatips inherit from the editor's font size anyway) and allow changing that percentage with a configuration option
Can you write a plug-in for PHP?
The
ide-php
plug-in's support foratom-ide-community
is not very friendly
The datatip implementation from atom-ide-ui shows the datatip when you place your mouse over code pieces.
instead of tracking any mouse movement and call into the datatip api as soon as the mouse moved around, it would be better to look for the mouse being stopped moving and analyze the position on which it has landed finally
this should reduce the number of calls to the datatip api significantly.
Looks like there is even an easy solution for that: https://stackoverflow.com/a/19262511
When I move my mouse cursor out of the variable, the datatip is unmounted after a little bit of delay.
From my experience of using atom-ide-ui
package, I felt it much better when the datatip was removed right after the mouse got out of the variable.
It would be really nice if atom-ide-datatip
also implement this behavior.
Currently, this package allows setting hover and stay time via single param. IMO it makes sense to allow configuration of hover and stay times each via own params. E.g., I'd prefer having a bigger delay on hover and no delay at all on blur.
See this run for example - https://github.com/atom-community/atom-ide-datatip/runs/1918445327?check_suite_focus=true
In the Release job, in the Build step -
(!) Plugin typescript: @rollup/plugin-typescript TS2554: Expected 0 arguments, but got 1.
should have stopped the CI from running.
given the following datatip
{
grammar: ... // a valid atom grammar
type: "snippet",
value: "(path: string) => string"
}
The datatip only shows
Related code:
https://github.com/appelgriebsch/atom-ide-datatip/blob/9c364d7c35072f6fb24b502f7ae4219406cb72e4/lib/datatip-view.js#L27-L30
Why does this code exist?
I installed this package and have been trying to use it. What do I need to install in order for it to work? simply the ide-{language}
package? Or does it need atom-ide-ui
? It would be awesome to avoid installing that.
The text inside datatip should be selectable, so people can copy it.
The datatip service defined in atom-ide-ui surfaces more functions that are currently not implemented here and cause atom to show an error notification:
export type DatatipService = {
addProvider(provider: DatatipProvider): IDisposable,
addModifierProvider(provider: ModifierDatatipProvider): IDisposable,
createPinnedDataTip(
datatip: Datatip,
editor: TextEditor,
options?: PinnedDatatipOptions,
): IDisposable,
};
Service definition in atom-ide-ui:
https://github.com/facebookarchive/atom-ide-ui/blob/710f8477607d3788aeadcbdd55079925241ce40d/modules/atom-ide-ui/pkg/atom-ide-datatip/lib/types.js#L18-L26
First off, thanks for putting together this project! I'm happy that y'all are continuing work on language server UI in atom.
I've been trying to get this to work with Flow, and ran into some problems that prevent datatips from displaying at all.
My apologies if I'm misunderstanding anything from reading/poking at the code. Here's what I've got:
grammar.name
and puts it in a DOM class of the datatip <code>
snippet
DatatipManager::getSnippetHtml
errors out on hover:DOMException: Failed to execute 'add' on 'DOMTokenList': The token provided
('flow javascript') contains HTML space characters, which are not valid in tokens
name
out of the class if the class is present rather than deferring to grammar
passed in to highlightCodeFragments
name
to an editor source via lib/utils.js
to pass to atom.grammars.assignLanguageMode
I'd like to open a PR (or two) to fix this up, and I'd be curious to hear what your thoughts are for the correct solution. I don't know all the implications of the different classNames that get added (e.g. I don't know what the lang-...
class here is for), but it seems to me that:
grammar.name
may not be the best grammar identifier to use, since it's purpose is "A human readable name for the language." (again from the atom docs)I'm thinking that rather than grammar.name
, atom-ide-datatip should grab the grammar scope (e.g. const grammar = editor.getGrammar().scopeName;
) rather than the name. scopeName
is described as "A unique, stable identifier for the language." Also, I think atom-ide-datatip should add the scope name to a data attribute rather than the className (e.g. data-scope
)
What do you think?
P.S. In the meantime, I have a very dirty workaround:
// lib/datatip-manager.js
async getSnippetHtml(snippets, grammarName) {
// ...
codeElem.classList.add(grammarName.split(' ')[0]);
// ...
}
Community Packages (46) C:\Users\linji\.atom\packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
It would be nice if:
When a user hovers on something, if there is an error at the same spot, the linter and datatip both will show a dialog.
There is a slight delay for showing datatips that should be reduced
I am very skeptical about loading atom-package-deps
everytime inside activation
function. I don't think this is needed.
https://github.com/atom-ide-community/atom-ide-datatip/blob/263a48d6afee3ae918b8588af1dbb66ff243698a/lib/main.js#L39
We should wrap this in an if
before loading it. This can significantly increase the performance for the subsequent loads (once dependencies are loaded).
Atom IDE data tips are not shown correctly using this new package:
jsdoc
docstringsExpected behavior:
Actual behavior:
Atom: 1.60.0 x64
Electron: 9.4.4
OS: Ubuntu 22.04
Thrown From: atom-ide-datatip package 0.25.0
Uncaught TypeError: Illegal invocation
At /home/fx/.atom/packages/atom-ide-datatip/dist/main.js:1
TypeError: Illegal invocation
at HTMLDocument.Z (/packages/atom-ide-datatip/dist/main.js:1:7942)
-2:15.1.0 intentions:highlight (input.hidden-input)
6x -2:14.9.0 editor:move-to-beginning-of-word (input.hidden-input)
5x -2:13.4.0 editor:move-to-end-of-word (input.hidden-input)
-2:11.3.0 intentions:highlight (input.hidden-input)
-2:09.2.0 editor:move-to-first-character-of-line (input.hidden-input)
-2:08.4.0 editor:move-to-end-of-screen-line (input.hidden-input)
-2:05.6.0 intentions:highlight (input.hidden-input)
-2:05.5.0 core:move-to-top (input.hidden-input)
-2:04.5.0 core:move-to-bottom (input.hidden-input)
-2:02.8.0 intentions:highlight (input.hidden-input)
-2:02.6.0 core:save (input.hidden-input)
-1:35.6.0 intentions:highlight (input.hidden-input)
-1:35 find-and-replace:use-selection-as-replace-pattern (input.hidden-input)
-1:31.2.0 omnisharp-atom:solution-status (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
-0:59.4.0 core:move-left (input.hidden-input)
-0:58.8.0 intentions:show (input.hidden-input)
atom-ide-base 3.4.0
atom-ide-code-format 1.0.3
atom-ide-datatip 0.25.0
atom-ide-definitions 0.4.2
atom-ide-hyperclick 1.0.11
atom-ide-markdown-service 2.1.0
atom-ide-outline 3.2.0
atom-ide-signature-help 0.16.0
atom-ide-ui 0.13.0
busy-signal 2.0.1
ide-csharp 0.6.2
ide-rust 1.1.2
intentions 2.1.1
language-rust 0.4.12
linter 3.4.0
linter-ui-default 3.4.1
omnisharp-atom 0.31.2
The code lives here:
https://github.com/atom-ide-community/atom-ide-base/blob/f2de0edd7e0ca3bcf1ccfffc46b31a20457c4d20/src-commons-ui/float-pane/MarkdownView.tsx#L28
https://github.com/atom-ide-community/atom-ide-base/blob/f2de0edd7e0ca3bcf1ccfffc46b31a20457c4d20/src-commons-ui/float-pane/SnippetView.tsx#L26
screen shot from @UziTech
I really don't think this is even desirable for a datatip since it leads users to believe that the datatip is interactive, while in reality we have #60. If we want to make the datatip prettier, I think a good way to do that would be to follow VS Code's approach to simply animate the appearance/disappearance of a datatip.
And certainly not have it as an option. The fewer options, the better.
master
branch failed. 🚨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.
An apm token must be created and set in the ATOM_ACCESS_TOKEN
environment variable on your CI environment.
Please visit your account page on atom.io and to set it in the ATOM_ACCESS_TOKEN
environment variable on your CI environment.
Good luck with your project ✨
Your semantic-release bot 📦🚀
[Enter steps to reproduce:]
Atom: 1.46.0-beta0 x64
Electron: 4.2.7
OS: Unknown Windows version
Thrown From: atom-ide-datatip package 0.11.4
Failed to activate the atom-ide-datatip package
At service.addModifierProvider is not a function
TypeError: service.addModifierProvider is not a function
at Activation.consumeDatatipService (/packages/atom-ide-ui/modules/atom-ide-ui/pkg/atom-ide-definitions/lib/main.js:314:32)
at /packages/atom-ide-ui/modules/nuclide-commons-atom/createPackage.js:64:34)
at Provider.provide (~/resources/app/static/<embedded>:14:1119368)
at ServiceHub.provide (~/resources/app/static/<embedded>:11:3279060)
at Package.activateServices (~/resources/app/static/<embedded>:11:3287346)
at Package.activateNow (~/resources/app/static/<embedded>:11:3284322)
at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (~/resources/app/static/<embedded>:14:2607)
at Function.simpleDispatch (~/resources/app/static/<embedded>:11:1215907)
at Emitter.emit (~/resources/app/static/<embedded>:11:1217348)
at PackageManager.triggerDeferredActivationHooks (~/resources/app/static/<embedded>:11:383144)
at activatePromise.Promise.all.then (~/resources/app/static/<embedded>:11:381895)
atom-ide-datatip 0.11.4
atom-ide-markdown-service 1.2.4
atom-ide-ui 0.13.0
atom-ide-vue 1.3.1
busy-signal 2.0.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.