あなたの問題の根本は、あなたのスコープ.source.python
が2回宣言されたと信じています。
最初に2番目の質問に答えるには、いいえ、私のsnippets.csonファイルは最初に開いたときに空白ではありませんでした。代わりに、次の内容が含まれていました:
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson
(これはMacOSにあります)。
各スコープは一度しか宣言できないことに注意してください。 2つのスニペットを同じスコープに含めるように変更すると、期待どおりに動作します。以下に、あなたのsnippets.cson
を変更
は私のために動作するように表示されます。
'.source.python':
'print statement':
'prefix': 'pr'
'body' : 'print "${1:Hello world}"'
'Argument variables import':
'prefix' : 'argv'
'body' : 'from sys import argv'
私は.source.python
スコープを一意に一度スニペットから、両方のスニペットは、メニューをインポートアクセスすることができます。
私は以前にWindows 10にアトムをインストールしており、このようなものを読んだことを覚えています。しかし、Ubuntuでは文字通り空白です。\ –
どの宣言が優先されますか?前か後? –
私はそれが宣言的な言語であると思われるので、_after_と思われます。また、OPは、彼の2番目のスニペットが機能していたが、最初のスニペットは動作していないと示唆した。 – jwir3