mrohland / plantuml Goto Github PK
View Code? Open in Web Editor NEWPlantuml package for Atom Text Editor
License: MIT License
Plantuml package for Atom Text Editor
License: MIT License
If the PNG file is already there and older than the puml file, then open the PNG directly.
Using library extensions with a label throws a syntax error if a label is used. The first example from the https://github.com/milo-minderbinder/AWS-PlantUML/README.MD fails. This example works in other PlantUML tools.
@startuml
define AWSP https://raw.githubusercontent.com/milo-minderbinder/AWS-PlantUML/release/18-2-22/dist
!includeurl AWSP/common.puml
!includeurl AWSP/Storage/AmazonS3/AmazonS3.puml
AMAZONS3(s3_internal)
AMAZONS3(s3_partner,"Vendor's S3")
s3_internal <-- s3_partner
@enduml
This is the error message.
[Enter steps to reproduce:]
Atom: 1.15.0 x64
Electron: 1.3.13
OS: Unknown Windows version
Thrown From: plantuml package 0.1.2
Uncaught TypeError: Cannot read property 'file' of undefined
At C:\Users\Home-PC\.atom\packages\plantuml\lib\file-utils.coffee:9
TypeError: Cannot read property 'file' of undefined
at module.exports.FileUtil.prepareFile (/packages/plantuml/lib/file-utils.coffee:9:8)
at Object.generate (/packages/plantuml/lib/plantuml.coffee:23:18)
at /packages/plantuml/lib/plantuml.coffee:12:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
at CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:3:59)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/app.asar/src/command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/app.asar/src/atom-environment.js:1162:28)
at EventEmitter.outerCallback (/app.asar/src/application-delegate.js:312:25)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
-0:14.7.0 plantuml:generate (atom-pane.pane.active)
plantuml 0.1.2
Hi! Pluntuml server now available officially in docker https://hub.docker.com/r/plantuml/plantuml-server/ so I think plugin should support it (just need an option to set server URI)
Use remote.Dialog
instead of remote.require("dialog")
Object.require (/Applications/Atom.app/Contents/Resources/app.asar/src/electron-shims.js:57:12)
Object.<anonymous> (/Users/Roger/.dotfiles/atom/packages/plantuml/lib/file-utils.coffee:8:19)
Object.<anonymous> (/Users/Roger/.dotfiles/atom/packages/plantuml/lib/file-utils.coffee:64:4)
Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:109:30)
Object..coffee (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:216:21)
Module.load (module.js:473:32)
[Enter steps to reproduce below:]
Atom Version: 1.3.2
System: Mac OS X 10.11.2
Thrown From: plantuml package, v0.1.2
Uncaught TypeError: path.basename is not a function
At /Users/jinke/.atom/packages/plantuml/lib/file-utils.coffee:35
TypeError: path.basename is not a function
at Function.module.exports.FileUtil.getPngFilename (/Users/jinke/.atom/packages/plantuml/lib/file-utils.coffee:35:21)
at module.exports.FileUtil.getPngFilePath (/Users/jinke/.atom/packages/plantuml/lib/file-utils.coffee:15:28)
at Object.module.exports.Plantuml.generate (/Users/jinke/.atom/packages/plantuml/lib/plantuml.coffee:25:23)
at atom-workspace.subscriptions.add.atom.commands.add.plantuml:generate (/Users/jinke/.atom/packages/plantuml/lib/plantuml.coffee:12:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1010:28)
at emitOne (events.js:77:13)
at EventEmitter.emit (events.js:169:7)
-0:30.7.0 application:new-file (ul.list-inline.tab-bar.inset-panel)
-0:27.6.0 grammar-selector:show (atom-text-editor.editor)
-0:24.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:17 core:paste (atom-text-editor.editor.is-focused)
-0:05.5.0 plantuml:generate (atom-text-editor.editor.is-focused)
{
"core": {
"themes": [
"one-light-ui",
"one-light-syntax"
]
}
}
# User
language-plantuml, v0.2.0
plantuml, v0.1.2
# Dev
No dev packages
Please make sure PlantUml can write to location of original file.
This error happens with all .plantUML files. I also tried to launch Atom from command line and I got same error.
I'm using Atom 1.0.2 on windows 7
Hi,
There is a syntax in plantuml that allows to select the file destination within the file. I don't have the documentation for it but if we use @startuml{images/diagram.png}
, the result goes in the directory named images with the name diagram.png (tested on unix). And it's correctly generated.
The atom script script fails with: 'Please make sure PlantUml can write to location of original file.'
The script is looking for an evaluated path from the original filename where it shouldn't.
Is it possiable to preview plantuml generated images on save, just like markdown preview.
Hi! Thanks for maintaining the plantuml package!
In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise
that resolves when the save is complete. Because of this, a few other Atom APIs that use save
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
Atom: 1.19.3 x64
Electron: 1.6.9
OS: Microsoft Windows 10 Pro
Thrown From: plantuml package 0.1.2
Uncaught TypeError: Cannot read property 'showSaveDialog' of undefined
At C:\Users\shad0w\.atom\packages\plantuml\lib\file-utils.coffee:27
TypeError: Cannot read property 'showSaveDialog' of undefined
at Function.module.exports.FileUtil.saveNewFile (/packages/plantuml/lib/file-utils.coffee:27:18)
at module.exports.FileUtil.prepareFile (/packages/plantuml/lib/file-utils.coffee:12:16)
at Object.generate (/packages/plantuml/lib/plantuml.coffee:23:18)
at /packages/plantuml/lib/plantuml.coffee:12:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.19.3/resources/app/src/command-registry.js:265:35)
at ~/AppData/Local/atom/app-1.19.3/resources/app/src/command-registry.js:3:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.19.3/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.19.3/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.19.3/resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.<anonymous> (~/AppData/Local/atom/app-1.19.3/resources/app/src/window-event-handler.js:3:65)
-0:32.6.0 intentions:highlight (input.hidden-input)
-0:32.5.0 core:paste (input.hidden-input)
-0:31.6.0 intentions:highlight (input.hidden-input)
-0:31.5.0 plantuml:generate (input.hidden-input)
38x -0:27.8.0 intentions:highlight (input.hidden-input)
-0:14.2.0 core:save (input.hidden-input)
2x -0:07.9.0 intentions:highlight (input.hidden-input)
-0:06.1.0 plantuml:generate (input.hidden-input)
atom-elixir 0.2.3
autocomplete-elixir 1.5.14
autocomplete-python 1.9.1
autocomplete-ruby 0.2.8
busy-signal 1.4.3
intentions 1.1.5
json-schema 0.1.15
language-batch 0.4.0
language-chef 0.10.0
language-elixir 0.19.0
language-groovy 0.7.0
language-plantuml 0.2.0
language-powershell 4.0.0
linter 2.2.0
linter-elixirc 1.7.0
linter-ruby 1.2.5
linter-ui-default 1.6.3
plantuml 0.1.2
plantuml-preview 0.12.9
plantuml-viewer 0.7.2
python-tools 0.6.9
ruby-block 0.3.6
Steps to reproduce:
@startuml version @enduml
Plantuml: Generate
actionI have tested running PlantUML manually and have been able to generate a png from the file in 1).
Atom Version: 1.0.2
System: Ubuntu 15.04
Thrown From: plantuml package, v0.1.2
Uncaught TypeError: undefined is not a function
At /home/roger/.atom/packages/plantuml/lib/file-utils.coffee:35
TypeError: undefined is not a function
at Function.module.exports.FileUtil.getPngFilename (/home/roger/.atom/packages/plantuml/lib/file-utils.coffee:51:23)
at module.exports.FileUtil.getPngFilePath (/home/roger/.atom/packages/plantuml/lib/file-utils.coffee:23:30)
at Object.module.exports.Plantuml.generate (/home/roger/.atom/packages/plantuml/lib/plantuml.coffee:35:25)
at atom-workspace.subscriptions.add.atom.commands.add.plantuml:generate (/home/roger/.atom/packages/plantuml/lib/plantuml.coffee:17:26)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:241:29)
at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/usr/share/atom/resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at space-pen-div.atom.commands.add.core:confirm (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:241:29)
-2:06.6.0 core:backspace (atom-text-editor.editor.is-focused)
2x -2:05.4.0 core:save (atom-text-editor.editor.is-focused)
-2:04.2.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-2:01.6.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-2:00.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-2:00.6.0 plantuml:generate (atom-text-editor.editor)
-0:09.3.0 editor:select-to-first-character-of-line (atom-text-editor.editor.is-focused)
-0:07.1.0 core:move-up (atom-text-editor.editor.is-focused)
-0:06.6.0 core:delete (atom-text-editor.editor.is-focused)
2x -0:06.2.0 core:move-down (atom-text-editor.editor.is-focused)
-0:05.4.0 core:move-up (atom-text-editor.editor.is-focused)
-0:04.9.0 core:delete (atom-text-editor.editor.is-focused)
-0:04.5.0 core:save (atom-text-editor.editor.is-focused)
-0:02.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-0:00.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:00.5.0 plantuml:generate (atom-text-editor.editor)
{
"core": {
"themes": [
"one-light-ui",
"one-light-syntax"
]
}
}
# User
atom-pair, v1.1.6
autoclose-html, v0.18.0
language-plantuml, v0.1.1
linter, v1.2.4
linter-ruby, v0.1.6
plantuml, v0.1.2
# Dev
No dev packages
Hi,
I receive an error message: "ReferenceError: path is not defined" when I tried to generate PlantUML file.
To fix it I add
path = require('path')
To the file: lib/file-utils.coffee, and it works.
If you can add it to update the package would be great.
plantuml
installed at /usr/local/bin/plantuml
and /usr/local/bin
is in $PATH
Atom Version: 0.210.0
System: Mac OS X 10.10.3
Thrown From: plantuml package, v0.1.0
Uncaught ReferenceError: path is not defined
At /Users/nguyenchr/.atom/packages/plantuml/lib/file-utils.coffee:34
ReferenceError: path is not defined
at Function.module.exports.FileUtil.getPngFilename (/Users/nguyenchr/.atom/packages/plantuml/lib/file-utils.coffee:34:16)
at module.exports.FileUtil.getPngFilePath (/Users/nguyenchr/.atom/packages/plantuml/lib/file-utils.coffee:14:28)
at Object.module.exports.Plantuml.generate (/Users/nguyenchr/.atom/packages/plantuml/lib/plantuml.coffee:25:23)
at atom-workspace.subscriptions.add.atom.commands.add.plantuml:generate (/Users/nguyenchr/.atom/packages/plantuml/lib/plantuml.coffee:12:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:180:20)
-0:01.1.0 plantuml:generate (atom-text-editor.editor.is-focused)
{
"core": {
"ignoredNames": [
".git",
".svn",
".DS_Store"
],
"disabledPackages": [
"vim-mode",
"go-plus",
"highlight-column"
],
"themes": [
"atom-light-ui",
"monokai"
]
}
}
# User
Sublime-Style-Column-Selection, v1.3.0
atom-jshint, v2.0.0
coffee-compile, v0.16.0
highlight-selected, v0.9.3
language-plantuml, v0.1.0
language-rust, v0.4.3
linter, v0.12.6
linter-rust, v0.1.0
monokai, v0.14.0
overrides, v0.10.0
plantuml, v0.1.0
pretty-json, v0.3.3
racer, v0.11.0
travis-ci-status, v0.15.0
# Dev
No dev packages
[Enter steps to reproduce below:]
Atom Version: 1.0.11
System: Microsoft Windows 8.1 Single Language
Thrown From: plantuml package, v0.1.2
Uncaught TypeError: Cannot read property 'basename' of undefined
At /C:/Users/Ali%20Imran/.atom/packages/plantuml/lib/file-utils.coffee:51
TypeError: Cannot read property 'basename' of undefined
at Function.module.exports.FileUtil.getPngFilename (C:\Users\Ali Imran\.atom\packages\plantuml\lib\file-utils.coffee:35:20)
at module.exports.FileUtil.getPngFilePath (C:\Users\Ali Imran\.atom\packages\plantuml\lib\file-utils.coffee:15:28)
at Object.module.exports.Plantuml.generate (C:\Users\Ali Imran\.atom\packages\plantuml\lib\plantuml.coffee:25:23)
at atom-workspace.subscriptions.add.atom.commands.add.plantuml:generate (C:\Users\Ali Imran\.atom\packages\plantuml\lib\plantuml.coffee:12:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:245:29)
at CommandRegistry.handleCommandEvent (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:3:61)
at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\command-registry.js:156:19)
at [object Object].jQuery.fn.trigger (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\space-pen-extensions.js:64:23)
at EventEmitter.<anonymous> (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\window-event-handler.js:75:67)
at emitTwo (events.js:87:13)
at EventEmitter.emit (events.js:169:7)
at EventEmitter.ipc.sendSync (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\atom.asar\renderer\api\lib\ipc.js:21:31)
at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\atom.asar\renderer\api\lib\remote.js:110:29)
at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\context-menu-manager.js:170:31)
at HTMLDocument.<anonymous> (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\window-event-handler.js:157:33)
at HTMLDocument.handler (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\src\space-pen-extensions.js:112:34)
at HTMLDocument.jQuery.event.dispatch (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
at HTMLDocument.elemData.handle (C:\Users\Ali Imran\AppData\Local\atom\app-1.0.11\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)
-0:36 go-to-line:toggle (atom-text-editor.editor)
-0:33.9.0 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:22.4.0 asciidoc-preview:toggle (atom-text-editor.editor.is-focused)
{
"core": {}
}
# User
asciidoc-preview, v0.6.0
language-asciidoc, v0.12.0
language-plantuml, v0.1.1
language-textile, v0.2.0
plantuml, v0.1.2
plantuml-viewer, v0.6.1
# Dev
No dev packages
Plantuml 0.1.0 accidentally expected some modules already required which are no longer with Atom >v0.199.0.
Add missing requires
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.